{"id":228,"date":"2010-04-18T00:40:00","date_gmt":"2010-04-17T16:40:00","guid":{"rendered":"http:\/\/localhost\/?p=228"},"modified":"2010-04-18T00:40:00","modified_gmt":"2010-04-17T16:40:00","slug":"hnoi2003_laser_bombs","status":"publish","type":"post","link":"https:\/\/www.shuizilong.com\/wjmzbmr\/?p=228","title":{"rendered":"[HNOI2003]\u6fc0\u5149\u70b8\u5f39"},"content":{"rendered":"\n<p>[HNOI2003]\u6fc0\u5149\u70b8\u5f39<\/p>\n<p>Time Limit:10000MS&#160; Memory Limit:165536K<br \/>Total Submit:49 Accepted:20 <br \/>Case Time Limit:1000MS<\/p>\n<p><strong>Description <\/strong><\/p>\n<p> \u4e00\u79cd\u65b0\u578b\u7684\u6fc0\u5149\u70b8\u5f39\uff0c\u53ef\u4ee5\u6467\u6bc1\u4e00\u4e2a\u8fb9\u957f\u4e3aR\u7684\u6b63\u65b9\u5f62\u5185\u7684\u6240\u6709\u7684\u76ee\u6807\u3002\u73b0\u5728\u5730\u56fe\u4e0a\u6709n(N&lt;=10000)\u4e2a\u76ee\u6807\uff0c\u7528\u6574\u6570Xi,Yi(\u5176\u503c\u5728 [0,5000])\u8868\u793a\u76ee\u6807\u5728\u5730\u56fe\u4e0a\u7684\u4f4d\u7f6e\uff0c\u6bcf\u4e2a\u76ee\u6807\u90fd\u6709\u4e00\u4e2a\u4ef7\u503c\u3002\u6fc0\u5149\u70b8\u5f39\u7684\u6295\u653e\u662f\u901a\u8fc7\u536b\u661f\u5b9a\u4f4d\u7684\uff0c\u4f46\u5176\u6709\u4e00\u4e2a\u7f3a\u70b9\uff0c\u5c31\u662f\u5176\u7206\u7834\u8303\u56f4\uff0c\u5373\u90a3\u4e2a\u8fb9\u957f\u4e3aR\u7684 \u6b63\u65b9\u5f62\u7684\u8fb9\u5fc5\u987b\u548cx\uff0cy\u8f74\u5e73\u884c\u3002\u82e5\u76ee\u6807\u4f4d\u4e8e\u7206\u7834\u6b63\u65b9\u5f62\u7684\u8fb9\u4e0a\uff0c\u8be5\u76ee\u6807\u5c06\u4e0d\u4f1a\u88ab\u6467\u6bc1\u3002 0<\/p>\n<p><strong>Input <\/strong><\/p>\n<p> \u8f93\u5165\u6587\u4ef6\u7684\u7b2c\u4e00\u884c\u4e3a\u6b63\u6574\u6570n\u548c\u6b63\u6574\u6570R\uff0c\u63a5\u4e0b\u6765\u7684n\u884c\u6bcf\u884c\u67093\u4e2a\u6b63\u6574\u6570\uff0c\u5206\u522b\u8868\u793a<\/p>\n<p><strong>Output <\/strong><\/p>\n<p> \u8f93\u51fa\u6587\u4ef6\u4ec5\u6709\u4e00\u4e2a\u6b63\u6574\u6570\uff0c\u8868\u793a\u4e00\u9897\u70b8\u5f39\u6700\u591a\u80fd\u70b8\u6389\u5730\u56fe\u4e0a\u603b\u4ef7\u503c\u4e3a\u591a\u5c11\u7684\u76ee\u6807\uff08\u7ed3\u679c\u4e0d\u4f1a\u8d85\u8fc732767\uff09\u3002<\/p>\n<p><strong>Sample Input <\/strong><\/p>\n<p>2 1<br \/>0 0 1<br \/>1 1 1<\/p>\n<p><strong>Sample Output <\/strong><\/p>\n<p>1<br \/>\u8fd9\u9053\u9898\u672c\u6765\u5e94\u8be5\u662f\u7528\u626b\u63cf\u7ebf+\u7ebf\u6bb5\u6811\u505a\u7684\uff0c\u4f46\u6211\u5f88\u65e0\u803b\u7684\u76f4\u63a5\u66b4\u529b\u679a\u4e3e\u6b63\u65b9\u5f62\u3002\u3002\u4e5f\u662f\u80fd\u8fc7\u7684\u56e7<br \/>\u3002\u3002\u3002<br \/>Code\uff1a<br \/>#include &lt;vector&gt;<br \/>#include &lt;cstdio&gt;<br \/>const int maxc=5002;<br \/>using namespace std;<br \/>int T[maxc][maxc]={0},n,r;<br \/>int main()<br \/>{<br \/>    scanf(&quot;%d %d&quot;,&amp;n,&amp;r);<br \/>    int x,y,c,a,ans=0;<br \/>    while(n&#8211;)scanf(&quot;%d%d%d&quot;,&amp;x,&amp;y,&amp;c),T[x+1][y+1]=c;<br \/>    for(int i=1;i&lt;maxc;i++)<br \/>        for(int j=1;j&lt;maxc;j++)<br \/>            T[i][j]+=T[i-1][j]+T[i][j-1]-T[i-1][j-1];<br \/>    for(int i=0;i+r&lt;maxc;i++)<br \/>        for(int j=0;j+r&lt;maxc;j++)<br \/>            if((a=T[i+r][j+r]+T[i][j]-T[i+r][j]-T[i][j+r])&gt;ans)<br \/>                ans=a;<br \/>    printf(&quot;%dn&quot;,ans);<br \/>}<\/p>\n<p><strong>Source <\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[HNOI2003]\u6fc0\u5149\u70b8\u5f39 Time Limit:10000MS&#160; Memory Limit:165536KTotal Submit:49 Accepted:20 Case Time Limit:1000MS Description \u4e00\u79cd\u65b0\u578b\u7684\u6fc0\u5149\u70b8\u5f39\uff0c\u53ef\u4ee5\u6467\u6bc1\u4e00\u4e2a\u8fb9\u957f\u4e3aR\u7684\u6b63\u65b9\u5f62\u5185\u7684\u6240\u6709\u7684\u76ee\u6807\u3002\u73b0\u5728\u5730\u56fe\u4e0a\u6709n(N&lt;=10000)\u4e2a\u76ee\u6807\uff0c\u7528\u6574\u6570Xi,Yi(\u5176\u503c\u5728 [0,5000])\u8868\u793a\u76ee\u6807\u5728\u5730\u56fe\u4e0a\u7684\u4f4d\u7f6e\uff0c\u6bcf\u4e2a\u76ee\u6807\u90fd\u6709\u4e00\u4e2a\u4ef7\u503c\u3002\u6fc0\u5149\u70b8\u5f39\u7684\u6295\u653e\u662f\u901a\u8fc7\u536b\u661f\u5b9a\u4f4d\u7684\uff0c\u4f46\u5176\u6709\u4e00\u4e2a\u7f3a\u70b9\uff0c\u5c31\u662f\u5176\u7206\u7834\u8303\u56f4\uff0c\u5373\u90a3\u4e2a\u8fb9\u957f\u4e3aR\u7684 \u6b63\u65b9\u5f62\u7684\u8fb9\u5fc5\u987b\u548cx\uff0cy\u8f74\u5e73\u884c\u3002\u82e5\u76ee\u6807\u4f4d\u4e8e\u7206\u7834\u6b63\u65b9\u5f62\u7684\u8fb9\u4e0a\uff0c\u8be5\u76ee\u6807\u5c06\u4e0d\u4f1a\u88ab\u6467\u6bc1\u3002 0 Input \u8f93\u5165\u6587\u4ef6\u7684\u7b2c\u4e00\u884c\u4e3a\u6b63\u6574\u6570n\u548c\u6b63\u6574\u6570R\uff0c\u63a5\u4e0b\u6765\u7684n\u884c\u6bcf\u884c\u67093\u4e2a\u6b63\u6574\u6570\uff0c\u5206\u522b\u8868\u793a Output \u8f93\u51fa\u6587\u4ef6\u4ec5\u6709\u4e00\u4e2a\u6b63\u6574\u6570\uff0c\u8868\u793a\u4e00\u9897\u70b8\u5f39\u6700\u591a\u80fd\u70b8\u6389\u5730\u56fe\u4e0a\u603b\u4ef7\u503c\u4e3a\u591a\u5c11\u7684\u76ee\u6807\uff08\u7ed3\u679c\u4e0d\u4f1a\u8d85\u8fc732767\uff09\u3002 Sample Input 2 10 0 11 1 1 Sample Output 1\u8fd9\u9053\u9898\u672c\u6765\u5e94\u8be5\u662f\u7528\u626b\u63cf\u7ebf+\u7ebf\u6bb5\u6811\u505a\u7684\uff0c\u4f46\u6211\u5f88\u65e0\u803b\u7684\u76f4\u63a5\u66b4\u529b\u679a\u4e3e\u6b63\u65b9\u5f62\u3002\u3002\u4e5f\u662f\u80fd\u8fc7\u7684\u56e7\u3002\u3002\u3002Code\uff1a#include &lt;vector&gt;#include &lt;cstdio&gt;const int maxc=5002;using namespace std;int T[maxc][maxc]={0},n,r;int main(){ scanf(&quot;%d %d&quot;,&amp;n,&amp;r); int x,y,c,a,ans=0; while(n&#8211;)scanf(&quot;%d%d%d&quot;,&amp;x,&amp;y,&amp;c),T[x+1][y+1]=c; for(int i=1;i&lt;maxc;i++) for(int j=1;j&lt;maxc;j++) T[i][j]+=T[i-1][j]+T[i][j-1]-T[i-1][j-1]; for(int i=0;i+r&lt;maxc;i++) for(int j=0;j+r&lt;maxc;j++) if((a=T[i+r][j+r]+T[i][j]-T[i+r][j]-T[i][j+r])&gt;ans) ans=a; printf(&quot;%dn&quot;,ans);} [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/posts\/228"}],"collection":[{"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=228"}],"version-history":[{"count":0,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/posts\/228\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}