{"id":615,"date":"2020-06-10T00:06:15","date_gmt":"2020-06-09T16:06:15","guid":{"rendered":"http:\/\/www.zyhcoding.club\/?p=615"},"modified":"2020-06-27T15:09:45","modified_gmt":"2020-06-27T07:09:45","slug":"6%e6%9c%88","status":"publish","type":"post","link":"http:\/\/www.zyhcoding.club\/index.php\/2020\/06\/10\/6%e6%9c%88\/","title":{"rendered":"2020 -6"},"content":{"rendered":"<h4>6-3 <a href=\"https:\/\/ac.nowcoder.com\/acm\/problem\/15034\">\u5fb7\u739b\u897f\u4e9a\u4e07\u5c81<\/a><\/h4>\n<p>\u72b6\u538bdp\u677f\u5b50\u3002\u3002\u3002<\/p>\n<pre><code>#include &lt;bits\/stdc++.h&gt;\nusing namespace std;\nconst int mod = 100000000;\nint n, m;\nint a[15][15];\nint b[13][1&lt;&lt;12];\nint ans[13][1&lt;&lt;12];\nint f(int i, int j){           \/\/f(i, j) \u8868\u793a\u7b2ci\u884c\u4e3a\u72b6\u6001j\u65f6\uff0c\u4e0d\u5408\u6cd5\u65f6\u8f93\u51fa-1\n    for (int k=1;k&lt;=m;k++)  if (!a[i][k] &amp;&amp; ((j&gt;&gt;(m-k))&amp;1))    return -1;\n    for (int k=1;k&lt;=m;k++)  if (((j&gt;&gt;(m-k))&amp;1) &amp;&amp; ((j&gt;&gt;(m-k+1))&amp;1))   return -1;\n    return 0;\n}\nint main(){\n    while (cin &gt;&gt; n &gt;&gt; m){\n        memset (ans, 0, sizeof ans);\n        int res = 0;\n        for (int i=1;i&lt;=n;i++)  for (int j=1;j&lt;=m;j++)\n            cin &gt;&gt; a[i][j];\n        for (int i=1;i&lt;=n;i++)    for (int j=0;j&lt;(1&lt;&lt;m);j++)\n            b[i][j] = f(i, j);\n        for (int j=0;j&lt;(1&lt;&lt;m);j++)  if (b[1][j]!=-1)\n            ans[1][j] = 1;\n        for (int i=2;i&lt;=n;i++)    for (int j=0;j&lt;(1&lt;&lt;m);j++)    if (b[i][j]!=-1){\n            for (int k=0;k&lt;(1&lt;&lt;m);k++)  if (b[i-1][k]!=-1){\n                if (j&amp;k)    continue;\n                ans[i][j] = (ans[i][j]+ans[i-1][k])%mod;\n            }\n        }\n        for (int j=0;j&lt;(1&lt;&lt;m);j++)\n            res = (res+ans[n][j])%mod;\n        cout &lt;&lt; res &lt;&lt; endl;\n    }\n    return 0;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>6-3 \u5fb7\u739b\u897f\u4e9a\u4e07\u5c81 \u72b6\u538bdp\u677f\u5b50\u3002\u3002\u3002 #include &lt;bits\/stdc++.h&#038;gt [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[46],"tags":[],"_links":{"self":[{"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/posts\/615"}],"collection":[{"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/comments?post=615"}],"version-history":[{"count":5,"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/posts\/615\/revisions"}],"predecessor-version":[{"id":645,"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/posts\/615\/revisions\/645"}],"wp:attachment":[{"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/media?parent=615"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/categories?post=615"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/tags?post=615"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}