{"id":258,"date":"2016-11-22T18:59:29","date_gmt":"2016-11-22T10:59:29","guid":{"rendered":"http:\/\/kylelv.com\/?p=258"},"modified":"2017-12-13T13:15:05","modified_gmt":"2017-12-13T05:15:05","slug":"bzoj-1088-scoi2005%e6%89%ab%e9%9b%b7mine","status":"publish","type":"post","link":"https:\/\/blog.kylelv.com\/?p=258","title":{"rendered":"bzoj 1088: [SCOI2005]\u626b\u96f7Mine"},"content":{"rendered":"<p>&nbsp;<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_73 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69fdef400bd29\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69fdef400bd29\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/blog.kylelv.com\/?p=258\/#1088_SCOI2005%E6%89%AB%E9%9B%B7Mine\" title=\"1088: [SCOI2005]\u626b\u96f7Mine\">1088: [SCOI2005]\u626b\u96f7Mine<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/blog.kylelv.com\/?p=258\/#Description\" title=\"Description\">Description<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/blog.kylelv.com\/?p=258\/#Input\" title=\"Input\">Input<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/blog.kylelv.com\/?p=258\/#Output\" title=\"Output\">Output<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/blog.kylelv.com\/?p=258\/#Sample_Input\" title=\"Sample Input\">Sample Input<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/blog.kylelv.com\/?p=258\/#Sample_Output\" title=\"Sample Output\">Sample Output<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/blog.kylelv.com\/?p=258\/#HINT\" title=\"HINT\">HINT<\/a><\/li><\/ul><\/nav><\/div>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"1088_SCOI2005%E6%89%AB%E9%9B%B7Mine\"><\/span>1088: [SCOI2005]\u626b\u96f7Mine<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span class=\"green\">Time Limit:\u00a010 Sec\u00a0\u00a0Memory Limit:\u00a0162 MB<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Description\"><\/span>Description<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<div class=\"content\">\n<p>\u3000\u3000\u76f8\u4fe1\u5927\u5bb6\u90fd\u73a9\u8fc7\u626b\u96f7\u7684\u6e38\u620f\u3002\u90a3\u662f\u5728\u4e00\u4e2an*m\u7684\u77e9\u9635\u91cc\u9762\u6709\u4e00\u4e9b\u96f7\uff0c\u8981\u4f60\u6839\u636e\u4e00\u4e9b\u4fe1\u606f\u627e\u51fa\u96f7\u6765\u3002\u4e07\u5723\u8282\u5230\u4e86<br \/>\n\uff0c\u201c\u4f59\u201d\u4eba\u56fd\u6d41\u884c\u8d77\u4e86\u4e00\u79cd\u7b80\u5355\u7684\u626b\u96f7\u6e38\u620f\uff0c\u8fd9\u4e2a\u6e38\u620f\u89c4\u5219\u548c\u626b\u96f7\u4e00\u6837\uff0c\u5982\u679c\u67d0\u4e2a\u683c\u5b50\u6ca1\u6709\u96f7\uff0c\u90a3\u4e48\u5b83\u91cc\u9762\u7684\u6570\u5b57<br \/>\n\u8868\u793a\u548c\u5b838\u8fde\u901a\u7684\u683c\u5b50\u91cc\u9762\u96f7\u7684\u6570\u76ee\u3002\u73b0\u5728\u68cb\u76d8\u662fn\u00d72\u7684\uff0c\u7b2c\u4e00\u5217\u91cc\u9762\u67d0\u4e9b\u683c\u5b50\u662f\u96f7\uff0c\u800c\u7b2c\u4e8c\u5217\u6ca1\u6709\u96f7\uff0c\u5982\u4e0b\u56fe\uff1a<br \/>\n\u7531\u4e8e\u7b2c\u4e00\u5217\u7684\u96f7\u53ef\u80fd\u6709\u591a\u79cd\u65b9\u6848\u6ee1\u8db3\u7b2c\u4e8c\u5217\u7684\u6570\u7684\u9650\u5236\uff0c\u4f60\u7684\u4efb\u52a1\u5373\u6839\u636e\u7b2c\u4e8c\u5217\u7684\u4fe1\u606f\u786e\u5b9a\u7b2c\u4e00\u5217\u96f7\u6709\u591a\u5c11\u79cd\u6446\u653e<br \/>\n\u65b9\u6848\u3002<\/p>\n<\/div>\n<h2><span class=\"ez-toc-section\" id=\"Input\"><\/span>Input<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<div class=\"content\">\n<p>\u3000\u3000\u7b2c\u4e00\u884c\u4e3aN\uff0c\u7b2c\u4e8c\u884c\u6709N\u4e2a\u6570\uff0c\u4f9d\u6b21\u4e3a\u7b2c\u4e8c\u5217\u7684\u683c\u5b50\u4e2d\u7684\u6570\u3002\uff081&lt;= N &lt;= 10000\uff09<\/p>\n<\/div>\n<h2><span class=\"ez-toc-section\" id=\"Output\"><\/span>Output<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<div class=\"content\">\n<p>\u3000\u3000\u4e00\u4e2a\u6570\uff0c\u5373\u7b2c\u4e00\u5217\u4e2d\u96f7\u7684\u6446\u653e\u65b9\u6848\u6570\u3002<\/p>\n<\/div>\n<h2><span class=\"ez-toc-section\" id=\"Sample_Input\"><\/span>Sample Input<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<div class=\"content\"><span class=\"sampledata\">2<br \/>\n1 1<\/span><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Sample_Output\"><\/span>Sample Output<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<div class=\"content\"><span class=\"sampledata\">2<\/span><\/div>\n<h2><span class=\"ez-toc-section\" id=\"HINT\"><\/span>HINT<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre class=\"lang:c++ decode:true \">#include&lt;cstdio&gt;\r\n#include&lt;string&gt;\r\n#include&lt;cstring&gt;\r\n#define N 20000\r\nusing namespace std;\r\nint n,ans,sec[N],fir[N];\r\nbool jud()\r\n{\r\n    for(int i=3;i&lt;=n+1;i++) fir[i]=sec[i-1]-fir[i-2]-fir[i-1];\r\n    return fir[n+1]?0:1;\r\n}\r\nint main()\r\n{\r\n    scanf(\"%d\",&amp;n);\r\n    for(int i=1;i&lt;=n;i++) scanf(\"%d\",&amp;sec[i]);\r\n    for(int i=0;i&lt;=sec[1];i++)\r\n    {\r\n        memset(fir,0,sizeof(fir));\r\n        fir[1]=i;\r\n        fir[2]=sec[1]-i;\r\n        if(jud()==true) ans++;\r\n    }\r\n    printf(\"%d\\n\",ans);\r\n    return 0;\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; 1088: [SCOI2005]\u626b\u96f7Mine Time Limit:\u00a010 Sec\u00a0\u00a0Memor [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-258","post","type-post","status-publish","format-standard","hentry","category-bzoj"],"_links":{"self":[{"href":"https:\/\/blog.kylelv.com\/index.php?rest_route=\/wp\/v2\/posts\/258","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.kylelv.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.kylelv.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.kylelv.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.kylelv.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=258"}],"version-history":[{"count":2,"href":"https:\/\/blog.kylelv.com\/index.php?rest_route=\/wp\/v2\/posts\/258\/revisions"}],"predecessor-version":[{"id":263,"href":"https:\/\/blog.kylelv.com\/index.php?rest_route=\/wp\/v2\/posts\/258\/revisions\/263"}],"wp:attachment":[{"href":"https:\/\/blog.kylelv.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.kylelv.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=258"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.kylelv.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}