{"id":81,"date":"2011-09-30T21:21:53","date_gmt":"2011-09-30T12:21:53","guid":{"rendered":"http:\/\/tech.fuqinho.net\/?p=81"},"modified":"2011-09-30T21:21:53","modified_gmt":"2011-09-30T12:21:53","slug":"google-code-jam-japan-2011-%e7%b7%b4%e7%bf%92%e5%95%8f%e9%a1%8c%e8%a7%a3%e3%81%84%e3%81%9f","status":"publish","type":"post","link":"https:\/\/tech.fuqinho.net\/?p=81","title":{"rendered":"Google Code Jam Japan 2011 \u7df4\u7fd2\u554f\u984c\u89e3\u3044\u305f"},"content":{"rendered":"<p>\t\t\t\t\u3061\u3083\u3093\u30683\u3064\u3068\u3082\u89e3\u3044\u305f\uff01<br \/>\n\u3053\u308c\u3067\u4e88\u9078\u306e\u6e96\u5099\u306f\u4e07\u7aef\u2026\u3000\u3060\u3068\u3044\u3044\u306a\u3002<\/p>\n<p>\u66f8\u3044\u305f\u30b3\u30fc\u30c9\u306f<a href=\"https:\/\/github.com\/fuqinho\/GoogleCodeJam\/tree\/master\/GCJ_Japan_2011_Practice\">\u3053\u3063\u3061(GitHub)<\/a>\u3067\u3059\u3002\u4ee5\u4e0b\u306f\u7c21\u5358\u306a\u89e3\u8aac\u3002<\/p>\n<h3>A: \u6570\u73e0\u3064\u306a\u304e<\/h3>\n<p>\u30b9\u30ca\u30c3\u30d1\u30fc\u306eOFF\/ON\u72b6\u614b\u30920\/1\u3067\u8868\u3059\u3068\u3001 0000 -&gt; 0001 -&gt; 0010 -&gt; 0011 -&gt; 0100 \u307f\u305f\u3044\u306b\u306a\u3063\u3066\u3066\u3001\u5897\u3048\u3066\u3044\u304f2\u9032\u6570\u3068\u540c\u3058\u5f62\u306b\u306a\u308b\u306e\u3067\u3001K\u306e\u6570\u30922\u9032\u6570\u8868\u73fe\u3057\u305f\u3068\u304d\u306b\u4e0b\u4f4dN\u30d3\u30c3\u30c8\u304c\u7acb\u3063\u3066\u3044\u308b\u304b\u3092\u8abf\u3079\u308c\u3070OK.<\/p>\n<h3>B: \u6570\u306e\u96c6\u5408<\/h3>\n<p>\u591a\u52062\u3064\u77e5\u3063\u3066\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3053\u3068\u304c\u3042\u308b\u3068\u601d\u3046\u30021\u3064\u306f\u7d20\u6570\u306e\u30ea\u30b9\u30c8\u306e\u4f5c\u308a\u65b9\u3067\u3001\u3053\u308c\u306f\u30a8\u30e9\u30c8\u30b9\u30c6\u30cd\u30b9\u306e\u3075\u308b\u3044\u3063\u3066\u3044\u3046\u306e\u3092\u4f7f\u3063\u305f\u3002\u3082\u3046\u4e00\u3064\u306f\u96c6\u5408\u3092\u52b9\u7387\u3088\u304f\u7d50\u5408\u3057\u3066\u3044\u304f\u65b9\u6cd5\u3067\u3001Union-Find\u3063\u3066\u3044\u3046\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u304c\u6709\u540d\u3089\u3057\u3044\u3002\u30c1\u30e3\u30ec\u30f3\u30b8\u30d6\u30c3\u30af\u3067\u7fd2\u3063\u305f\u3002\u305d\u306e\uff12\u3064\u304c\u4f7f\u3048\u308c\u3070\u3001\u3042\u3068\u306fP\u4ee5\u4e0a\u306e\u7d20\u6570\u3054\u3068\u306b\u533a\u9593\u5185\u304b\u3089\u305d\u306e\u7d20\u6570\u306e\u500d\u6570\u3092\u63a2\u3057\u3066\u3001\u5c5e\u3057\u3066\u308b\u96c6\u5408\u3092\u7d50\u5408\u3057\u3066\u3044\u304f\u3060\u3051\u3002\u533a\u9593\u306e\u9577\u3055\u3092\u8d85\u3048\u308b\u7d20\u6570\u306f2\u3064\u4ee5\u4e0a\u500d\u6570\u304c\u898b\u3064\u304b\u308b\u53ef\u80fd\u6027\u304c\u7121\u3044\u306e\u3067\u7528\u306f\u7121\u3044\u3067\u3059\u3002<\/p>\n<h3>C: \u904a\u5712\u5730<\/h3>\n<p>\u8a08\u7b97\u7d50\u679c\u3092\u30e1\u30e2\u3057\u3066\u304a\u304f\u5de5\u592b\u3068\u5468\u671f\u7684\u306a\u52d5\u304d\u3092\u5229\u7528\u3059\u308b\u5de5\u592b\u3067\u8a08\u7b97\u91cf\u3092\u6e1b\u3089\u305b\u308b\u554f\u984c\u3002\u300ci\u30b0\u30eb\u30fc\u30d7\u76ee\u304c\u5148\u982d\u306e\u72b6\u614b\u3067\u30b3\u30fc\u30b9\u30bf\u30fc\u304c\u6765\u305f\u3089\u3001\u4f55\u4eba\u4e57\u308c\u3066\u3001\u6b21\u306f\u3069\u306e\u30b0\u30eb\u30fc\u30d7\u304c\u5148\u982d\u306b\u306a\u308b\u306e\u304b\u300d\u3092\u5148\u306b\u8a08\u7b97\u3057\u3066\u304a\u3044\u3066\u518d\u5229\u7528\u3059\u308b\u65b9\u6cd5\u3067large\u304c10\u79d2\u304f\u3089\u3044\u3002\u300ci\u30b0\u30eb\u30fc\u30d7\u76ee\u304c\u5148\u982d\u306e\u72b6\u614b\u304b\u3089\u3044\u304f\u3064\u304b\u30b3\u30fc\u30b9\u30bf\u30fc\u304c\u6765\u305f\u3089\u307e\u305fi\u30b0\u30eb\u30fc\u30d7\u76ee\u304c\u5148\u982d\u306b\u306a\u3063\u305f\u300d\u3068\u3044\u3046\u30eb\u30fc\u30d7\u72b6\u614b\u3092\u898b\u3064\u3051\u3066\u3001\u305d\u306e\u90e8\u5206\u306e\u8a08\u7b97\u3092\u306f\u3057\u3087\u308b\u3068\u3001large\u304c0.05\u79d2\u304f\u3089\u3044\u3067\u3057\u305f\u3002<\/p>\n<p>\u89e3\u304f\u306e\u6642\u9593\u304b\u304b\u3063\u305f\u3051\u3069\u3001\u52c9\u5f37\u306b\u306a\u308b\u306a\u3041<\/p>\n<p><a href=\"http:\/\/www.amazon.co.jp\/gp\/product\/4839931992\/ref=as_li_ss_il?ie=UTF8&#038;tag=tqbfjotld-22&#038;linkCode=as2&#038;camp=247&#038;creative=7399&#038;creativeASIN=4839931992\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/ws.assoc-amazon.jp\/widgets\/q?_encoding=UTF8&#038;Format=_SL160_&#038;ASIN=4839931992&#038;MarketPlace=JP&#038;ID=AsinImage&#038;WS=1&#038;tag=tqbfjotld-22&#038;ServiceVersion=20070822\" ><\/a><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.assoc-amazon.jp\/e\/ir?t=tqbfjotld-22&#038;l=as2&#038;o=9&#038;a=4839931992\" width=\"1\" height=\"1\" border=\"0\" alt=\"\" style=\"border:none !important; margin:0px !important;\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3061\u3083\u3093\u30683\u3064\u3068\u3082\u89e3\u3044\u305f\uff01 \u3053\u308c\u3067\u4e88\u9078\u306e\u6e96\u5099\u306f\u4e07\u7aef\u2026\u3000\u3060\u3068\u3044\u3044\u306a\u3002 \u66f8\u3044\u305f\u30b3\u30fc\u30c9\u306f\u3053\u3063\u3061(GitHub)\u3067\u3059\u3002\u4ee5\u4e0b\u306f\u7c21\u5358\u306a\u89e3\u8aac\u3002 A: \u6570\u73e0\u3064\u306a\u304e \u30b9\u30ca\u30c3\u30d1\u30fc\u306eOFF\/ON\u72b6\u614b\u30920\/1\u3067\u8868\u3059\u3068\u3001 0000 -&gt; 00 &#8230; <a title=\"Google Code Jam Japan 2011 \u7df4\u7fd2\u554f\u984c\u89e3\u3044\u305f\" class=\"read-more\" href=\"https:\/\/tech.fuqinho.net\/?p=81\" aria-label=\"\u8a73\u7d30\u306f\u3053\u3061\u3089 Google Code Jam Japan 2011 \u7df4\u7fd2\u554f\u984c\u89e3\u3044\u305f\">\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[2],"tags":[5,7],"class_list":["post-81","post","type-post","status-publish","format-standard","hentry","category-2","tag-cpp","tag-googlecodejam"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.2.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Google Code Jam Japan 2011 \u7df4\u7fd2\u554f\u984c\u89e3\u3044\u305f - Happy Coder<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/tech.fuqinho.net\/?p=81\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Google Code Jam Japan 2011 \u7df4\u7fd2\u554f\u984c\u89e3\u3044\u305f - Happy Coder\" \/>\n<meta property=\"og:description\" content=\"\u3061\u3083\u3093\u30683\u3064\u3068\u3082\u89e3\u3044\u305f\uff01 \u3053\u308c\u3067\u4e88\u9078\u306e\u6e96\u5099\u306f\u4e07\u7aef\u2026\u3000\u3060\u3068\u3044\u3044\u306a\u3002 \u66f8\u3044\u305f\u30b3\u30fc\u30c9\u306f\u3053\u3063\u3061(GitHub)\u3067\u3059\u3002\u4ee5\u4e0b\u306f\u7c21\u5358\u306a\u89e3\u8aac\u3002 A: \u6570\u73e0\u3064\u306a\u304e \u30b9\u30ca\u30c3\u30d1\u30fc\u306eOFF\/ON\u72b6\u614b\u30920\/1\u3067\u8868\u3059\u3068\u3001 0000 -&gt; 00 ... \u7d9a\u304d\u3092\u8aad\u3080\" \/>\n<meta property=\"og:url\" content=\"https:\/\/tech.fuqinho.net\/?p=81\" \/>\n<meta property=\"og:site_name\" content=\"Happy Coder\" \/>\n<meta property=\"article:published_time\" content=\"2011-09-30T12:21:53+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/ws.assoc-amazon.jp\/widgets\/q?_encoding=UTF8&Format=_SL160_&ASIN=4839931992&MarketPlace=JP&ID=AsinImage&WS=1&tag=tqbfjotld-22&ServiceVersion=20070822\" \/>\n<meta name=\"author\" content=\"fuqinho\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"fuqinho\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/tech.fuqinho.net\/?p=81#article\",\"isPartOf\":{\"@id\":\"https:\/\/tech.fuqinho.net\/?p=81\"},\"author\":{\"name\":\"fuqinho\",\"@id\":\"https:\/\/tech.fuqinho.net\/#\/schema\/person\/3f5c2a20c9acba8360c501cb7038a4e7\"},\"headline\":\"Google Code Jam Japan 2011 \u7df4\u7fd2\u554f\u984c\u89e3\u3044\u305f\",\"datePublished\":\"2011-09-30T12:21:53+00:00\",\"dateModified\":\"2011-09-30T12:21:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/tech.fuqinho.net\/?p=81\"},\"wordCount\":28,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/tech.fuqinho.net\/#\/schema\/person\/3f5c2a20c9acba8360c501cb7038a4e7\"},\"keywords\":[\"Cpp\",\"GoogleCodeJam\"],\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/tech.fuqinho.net\/?p=81#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/tech.fuqinho.net\/?p=81\",\"url\":\"https:\/\/tech.fuqinho.net\/?p=81\",\"name\":\"Google Code Jam Japan 2011 \u7df4\u7fd2\u554f\u984c\u89e3\u3044\u305f - Happy Coder\",\"isPartOf\":{\"@id\":\"https:\/\/tech.fuqinho.net\/#website\"},\"datePublished\":\"2011-09-30T12:21:53+00:00\",\"dateModified\":\"2011-09-30T12:21:53+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/tech.fuqinho.net\/?p=81#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/tech.fuqinho.net\/?p=81\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/tech.fuqinho.net\/?p=81#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u30db\u30fc\u30e0\",\"item\":\"https:\/\/tech.fuqinho.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Google Code Jam Japan 2011 \u7df4\u7fd2\u554f\u984c\u89e3\u3044\u305f\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/tech.fuqinho.net\/#website\",\"url\":\"https:\/\/tech.fuqinho.net\/\",\"name\":\"Happy Coder\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/tech.fuqinho.net\/#\/schema\/person\/3f5c2a20c9acba8360c501cb7038a4e7\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/tech.fuqinho.net\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"ja\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/tech.fuqinho.net\/#\/schema\/person\/3f5c2a20c9acba8360c501cb7038a4e7\",\"name\":\"fuqinho\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/tech.fuqinho.net\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/tech.fuqinho.net\/wp-content\/uploads\/2023\/02\/hatena-block_400x400.png\",\"contentUrl\":\"https:\/\/tech.fuqinho.net\/wp-content\/uploads\/2023\/02\/hatena-block_400x400.png\",\"width\":400,\"height\":400,\"caption\":\"fuqinho\"},\"logo\":{\"@id\":\"https:\/\/tech.fuqinho.net\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/tech.fuqinho.net\"],\"url\":\"https:\/\/tech.fuqinho.net\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Google Code Jam Japan 2011 \u7df4\u7fd2\u554f\u984c\u89e3\u3044\u305f - Happy Coder","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/tech.fuqinho.net\/?p=81","og_locale":"ja_JP","og_type":"article","og_title":"Google Code Jam Japan 2011 \u7df4\u7fd2\u554f\u984c\u89e3\u3044\u305f - Happy Coder","og_description":"\u3061\u3083\u3093\u30683\u3064\u3068\u3082\u89e3\u3044\u305f\uff01 \u3053\u308c\u3067\u4e88\u9078\u306e\u6e96\u5099\u306f\u4e07\u7aef\u2026\u3000\u3060\u3068\u3044\u3044\u306a\u3002 \u66f8\u3044\u305f\u30b3\u30fc\u30c9\u306f\u3053\u3063\u3061(GitHub)\u3067\u3059\u3002\u4ee5\u4e0b\u306f\u7c21\u5358\u306a\u89e3\u8aac\u3002 A: \u6570\u73e0\u3064\u306a\u304e \u30b9\u30ca\u30c3\u30d1\u30fc\u306eOFF\/ON\u72b6\u614b\u30920\/1\u3067\u8868\u3059\u3068\u3001 0000 -&gt; 00 ... \u7d9a\u304d\u3092\u8aad\u3080","og_url":"https:\/\/tech.fuqinho.net\/?p=81","og_site_name":"Happy Coder","article_published_time":"2011-09-30T12:21:53+00:00","og_image":[{"url":"http:\/\/ws.assoc-amazon.jp\/widgets\/q?_encoding=UTF8&Format=_SL160_&ASIN=4839931992&MarketPlace=JP&ID=AsinImage&WS=1&tag=tqbfjotld-22&ServiceVersion=20070822"}],"author":"fuqinho","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"fuqinho"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/tech.fuqinho.net\/?p=81#article","isPartOf":{"@id":"https:\/\/tech.fuqinho.net\/?p=81"},"author":{"name":"fuqinho","@id":"https:\/\/tech.fuqinho.net\/#\/schema\/person\/3f5c2a20c9acba8360c501cb7038a4e7"},"headline":"Google Code Jam Japan 2011 \u7df4\u7fd2\u554f\u984c\u89e3\u3044\u305f","datePublished":"2011-09-30T12:21:53+00:00","dateModified":"2011-09-30T12:21:53+00:00","mainEntityOfPage":{"@id":"https:\/\/tech.fuqinho.net\/?p=81"},"wordCount":28,"commentCount":0,"publisher":{"@id":"https:\/\/tech.fuqinho.net\/#\/schema\/person\/3f5c2a20c9acba8360c501cb7038a4e7"},"keywords":["Cpp","GoogleCodeJam"],"inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/tech.fuqinho.net\/?p=81#respond"]}]},{"@type":"WebPage","@id":"https:\/\/tech.fuqinho.net\/?p=81","url":"https:\/\/tech.fuqinho.net\/?p=81","name":"Google Code Jam Japan 2011 \u7df4\u7fd2\u554f\u984c\u89e3\u3044\u305f - Happy Coder","isPartOf":{"@id":"https:\/\/tech.fuqinho.net\/#website"},"datePublished":"2011-09-30T12:21:53+00:00","dateModified":"2011-09-30T12:21:53+00:00","breadcrumb":{"@id":"https:\/\/tech.fuqinho.net\/?p=81#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/tech.fuqinho.net\/?p=81"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/tech.fuqinho.net\/?p=81#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/tech.fuqinho.net\/"},{"@type":"ListItem","position":2,"name":"Google Code Jam Japan 2011 \u7df4\u7fd2\u554f\u984c\u89e3\u3044\u305f"}]},{"@type":"WebSite","@id":"https:\/\/tech.fuqinho.net\/#website","url":"https:\/\/tech.fuqinho.net\/","name":"Happy Coder","description":"","publisher":{"@id":"https:\/\/tech.fuqinho.net\/#\/schema\/person\/3f5c2a20c9acba8360c501cb7038a4e7"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/tech.fuqinho.net\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"ja"},{"@type":["Person","Organization"],"@id":"https:\/\/tech.fuqinho.net\/#\/schema\/person\/3f5c2a20c9acba8360c501cb7038a4e7","name":"fuqinho","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/tech.fuqinho.net\/#\/schema\/person\/image\/","url":"https:\/\/tech.fuqinho.net\/wp-content\/uploads\/2023\/02\/hatena-block_400x400.png","contentUrl":"https:\/\/tech.fuqinho.net\/wp-content\/uploads\/2023\/02\/hatena-block_400x400.png","width":400,"height":400,"caption":"fuqinho"},"logo":{"@id":"https:\/\/tech.fuqinho.net\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/tech.fuqinho.net"],"url":"https:\/\/tech.fuqinho.net\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/tech.fuqinho.net\/index.php?rest_route=\/wp\/v2\/posts\/81","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tech.fuqinho.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.fuqinho.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.fuqinho.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.fuqinho.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=81"}],"version-history":[{"count":0,"href":"https:\/\/tech.fuqinho.net\/index.php?rest_route=\/wp\/v2\/posts\/81\/revisions"}],"wp:attachment":[{"href":"https:\/\/tech.fuqinho.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=81"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.fuqinho.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=81"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.fuqinho.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=81"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}