{"id":734,"date":"2026-04-18T01:09:51","date_gmt":"2026-04-17T17:09:51","guid":{"rendered":"http:\/\/wordpress.fangt.online\/?p=734"},"modified":"2026-04-18T01:10:20","modified_gmt":"2026-04-17T17:10:20","slug":"p1228-%e5%9c%b0%e6%af%af%e5%a1%ab%e8%a1%a5%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/wordpress.fangt.online\/index.php\/2026\/04\/18\/p1228-%e5%9c%b0%e6%af%af%e5%a1%ab%e8%a1%a5%e9%97%ae%e9%a2%98\/","title":{"rendered":"P1228\u00a0\u5730\u6bef\u586b\u8865\u95ee\u9898"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>#include &lt;bits\/stdc++.h>\nusing namespace std;\nint k,x,y,n;\nint pow2(int k){\n    int sum=1;\n    while(k--) sum*=2;\n    return sum;\n}\nvoid f(int x,int y,int a,int b,int l)\n{\n    if(l==1) return;\n    if(x-a&lt;=l\/2-1 &amp;&amp; y-b&lt;=l\/2-1){\n        printf(\"%d %d 1\\n\",a+l\/2,b+l\/2);\n        f(x,y,a,b,l\/2);\n        f(a+l\/2-1,b+l\/2,a,b+l\/2,l\/2);\n        f(a+l\/2,b+l\/2-1,a+l\/2,b,l\/2);\n        f(a+l\/2,b+l\/2,a+l\/2,b+l\/2,l\/2);\n    }\n    else if(x-a&lt;=l\/2-1 &amp;&amp; y-b>l\/2-1){\n        printf(\"%d %d 2\\n\",a+l\/2,b+l\/2-1);\n        f(a+l\/2-1,b+l\/2-1,a,b,l\/2);\n        f(x,y,a,b+l\/2,l\/2);\n        f(a+l\/2,b+l\/2-1,a+l\/2,b,l\/2);\n        f(a+l\/2,b+l\/2,a+l\/2,b+l\/2,l\/2);\n    }\n    else if(x-a>l\/2-1 &amp;&amp; y-b&lt;=l\/2-1){\n        printf(\"%d %d 3\\n\",a+l\/2-1,b+l\/2);\n        f(a+l\/2-1,b+l\/2-1,a,b,l\/2);\n        f(a+l\/2-1,b+l\/2,a,b+l\/2,l\/2);\n        f(x,y,a+l\/2,b,l\/2);\n        f(a+l\/2,b+l\/2,a+l\/2,b+l\/2,l\/2);\n    }\n    else{\n        printf(\"%d %d 4\\n\",a+l\/2-1,b+l\/2-1);\n        f(a+l\/2-1,b+l\/2-1,a,b,l\/2);\n        f(a+l\/2-1,b+l\/2,a,b+l\/2,l\/2);\n        f(a+l\/2,b+l\/2-1,a+l\/2,b,l\/2);\n        f(x,y,a+l\/2,b+l\/2,l\/2);\n    }\n}\nint main()\n{\n    cin>>k>>x>>y;;\n    n=pow2(k);\n    f(x,y,1,1,n);\n    return 0;\n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[],"class_list":["post-734","post","type-post","status-publish","format-standard","hentry","category-st"],"_links":{"self":[{"href":"http:\/\/wordpress.fangt.online\/index.php\/wp-json\/wp\/v2\/posts\/734","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wordpress.fangt.online\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wordpress.fangt.online\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wordpress.fangt.online\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/wordpress.fangt.online\/index.php\/wp-json\/wp\/v2\/comments?post=734"}],"version-history":[{"count":1,"href":"http:\/\/wordpress.fangt.online\/index.php\/wp-json\/wp\/v2\/posts\/734\/revisions"}],"predecessor-version":[{"id":735,"href":"http:\/\/wordpress.fangt.online\/index.php\/wp-json\/wp\/v2\/posts\/734\/revisions\/735"}],"wp:attachment":[{"href":"http:\/\/wordpress.fangt.online\/index.php\/wp-json\/wp\/v2\/media?parent=734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wordpress.fangt.online\/index.php\/wp-json\/wp\/v2\/categories?post=734"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wordpress.fangt.online\/index.php\/wp-json\/wp\/v2\/tags?post=734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}