{"id":559,"date":"2020-11-26T23:31:06","date_gmt":"2020-11-26T15:31:06","guid":{"rendered":"http:\/\/nocriz.com\/?p=559"},"modified":"2021-10-02T02:57:37","modified_gmt":"2021-10-01T18:57:37","slug":"cerc-16-d","status":"publish","type":"post","link":"https:\/\/nocriz.com\/?p=559","title":{"rendered":"CERC 16 D"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/nocriz.com\/wp-content\/uploads\/2020\/11\/image-1024x1024.png\" alt=\"\" class=\"wp-image-560\" width=\"256\" height=\"256\" srcset=\"https:\/\/nocriz.com\/wp-content\/uploads\/2020\/11\/image.png 1024w, https:\/\/nocriz.com\/wp-content\/uploads\/2020\/11\/image-300x300.png 300w, https:\/\/nocriz.com\/wp-content\/uploads\/2020\/11\/image-150x150.png 150w, https:\/\/nocriz.com\/wp-content\/uploads\/2020\/11\/image-768x768.png 768w\" sizes=\"(max-width: 256px) 100vw, 256px\" \/><figcaption>\u505a\u4e86\u4e2a\u65b0\u7684CF\u5934\u50cf<\/figcaption><\/figure>\n\n\n\n<p>\u5509\uff0c\u7d2f\u4e86\uff0c\u9898\u662f\u597d\u9898\uff0c\u505a\u51fa\u6b64\u9898\u611f\u89c9\u8fd8\u662f\u4e0d\u9519\u7684\uff0c\u53ea\u662f\u6ca1\u65f6\u95f4\u5199\u9898\u89e3\u4e86\u3002<\/p>\n\n\n\n<p>\u4e5f\u6ca1\u65f6\u95f4\u6253\u7b97\u6cd5\u7ade\u8d5b\u4e86\uff0c\u5468\u672b\u8fd8\u8981\u78e8\u9524\u5b50\u3002\u6211\u597d\u96be\u554a\u3002<\/p>\n\n\n\n<p>\u4e5f\u6ca1\u65f6\u95f4\u5199\u4f5c\u4e1a\u4e86\u3002<\/p>\n\n\n\n<p>\u4e5f\u6ca1\u65f6\u95f4\u7761\u89c9\u4e86\u3002<\/p>\n\n\n\n<p>\u4f46\u662f\u5e0c\u671b\u5468\u65e5\u8fd8\u662f\u80fd\u4e0a\u5206\uff0c\u6bd5\u7adf\u4eba\uff0c\u8981\u6709\u68a6\u60f3<\/p>\n\n\n\n<!--more-->\n\n\n\n<pre class=\"wp-block-code\"><code>\nint dp&#91;10]&#91;10];\nvector&lt;int> V&#91;6]&#91;6];\n\nvoid msort(int a,int b,int c){\n\tvector&lt;int> SO,S2;\n\t\/\/debug(a,b,V&#91;a]&#91;b],c);\n\tfor(int i=0;i&lt;c;i++){\n\t\tSO.push_back(V&#91;a]&#91;b].back());\n\t\tV&#91;a]&#91;b].pop_back();\n\t}\n\tif(a+b == 10){\n\t\/\/\tdebug(SO&#91;0]);\n\t\treturn;\n\t}\n\tif(a+b == 9 &amp;&amp; c == 2){\n\t\tif(SO&#91;0]>SO&#91;1]){\n\t\t\tif(a == 4) cout&lt;&lt;\"5 6 D 1\\n5 6 D 1\\n\";\n\t\t\telse cout&lt;&lt;\"6 5 R 1\\n6 5 R 1\\n\";\n\t\t}else{\n\t\t\tif(a == 4) cout&lt;&lt;\"5 6 D 2\\n\";\n\t\t\telse cout&lt;&lt;\"6 5 R 2\\n\";\n\t\t}\n\t\treturn;\n\t}\n\tS2 = SO;\n\tsort(all(S2));\n\tint ccnt&#91;6]&#91;6] = {0};\n\tfor(auto ct:SO){\n\t\tint rk = S2.size()-(lower_bound(all(S2),ct)-S2.begin());\n\t\tfor(int x=5;x>=a;x-=1){\n\t\t\tfor(int y=5;y>=b;y-=1){\n\t\t\t\tif(x == a &amp;&amp; y == b)continue;\n\t\t\t\trk-=dp&#91;6-x]&#91;6-y];\n\t\t\t\tif(rk&lt;=0){\n\t\t\t\t\tccnt&#91;x]&#91;y]+=1;\n\t\t\t\t\tV&#91;x]&#91;y].PB(ct);\n\t\t\t\t\tfor(int i=a;i&lt;x;i++)cout&lt;&lt;i+1&lt;&lt;' '&lt;&lt;b+1&lt;&lt;\" D 1\\n\";\n\t\t\t\t\tfor(int i=b;i&lt;y;i++)cout&lt;&lt;x+1&lt;&lt;' '&lt;&lt;i+1&lt;&lt;\" R 1\\n\";\n\t\t\t\t\tgoto nxt;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tnxt:;\n\t}\n\tfor(int x=5;x>=a;x-=1){\n\t\tfor(int y=5;y>=b;y-=1){\n\t\t\tif(ccnt&#91;x]&#91;y])msort(x,y,ccnt&#91;x]&#91;y]);\n\t\t}\n\t}\n}\n\nint main() {\n    for(int i=1;i&lt;=6;i++){\n    \tfor(int j=1;j&lt;=6;j++){\n    \t\tif(i+j == 2){\n    \t\t\tdp&#91;i]&#91;j] = 1;\n    \t\t\tcontinue;\n    \t\t}\n    \t\tif(i+j == 3){\n    \t\t\tdp&#91;i]&#91;j] = 2;\n    \t\t\tcontinue;\n    \t\t}\n    \t\tfor(int k=1;k&lt;=i;k++){\n    \t\t\tfor(int l=1;l&lt;=j;l++){\n    \t\t\t\tif(!(k == i &amp;&amp; l == j))dp&#91;i]&#91;j]+=dp&#91;k]&#91;l];\n    \t\t\t}\n    \t\t}\n    \t}\n    }\n    int n,c;\n    read(n);\n    for(int i=1;i&lt;=n;i++){\n    \tread(c);\n    \tV&#91;0]&#91;0].PB(c);\n    }\n    msort(0,0,n);\n    return 0;\n}<\/code><\/pre>\n\n\n\n<p><\/p>\n ","protected":false},"excerpt":{"rendered":"<p>\u5509\uff0c\u7d2f\u4e86\uff0c\u9898\u662f\u597d\u9898\uff0c\u505a\u51fa\u6b64\u9898\u611f\u89c9\u8fd8\u662f\u4e0d\u9519\u7684\uff0c\u53ea\u662f\u6ca1\u65f6\u95f4\u5199\u9898\u89e3\u4e86\u3002 \u4e5f\u6ca1\u65f6\u95f4\u6253\u7b97\u6cd5\u7ade\u8d5b\u4e86\uff0c\u5468\u672b\u8fd8\u8981\u78e8\u9524\u5b50\u3002\u6211\u597d\u96be [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/nocriz.com\/index.php?rest_route=\/wp\/v2\/posts\/559"}],"collection":[{"href":"https:\/\/nocriz.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nocriz.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nocriz.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nocriz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=559"}],"version-history":[{"count":1,"href":"https:\/\/nocriz.com\/index.php?rest_route=\/wp\/v2\/posts\/559\/revisions"}],"predecessor-version":[{"id":561,"href":"https:\/\/nocriz.com\/index.php?rest_route=\/wp\/v2\/posts\/559\/revisions\/561"}],"wp:attachment":[{"href":"https:\/\/nocriz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=559"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nocriz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=559"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nocriz.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=559"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}