{"id":118,"date":"2026-04-09T16:36:45","date_gmt":"2026-04-09T08:36:45","guid":{"rendered":"https:\/\/\u9f50\u6cb3\u4e00\u4e2d.cn\/blog\/?p=118"},"modified":"2026-04-11T16:37:02","modified_gmt":"2026-04-11T08:37:02","slug":"%e5%b7%ae%e5%88%86","status":"publish","type":"post","link":"https:\/\/\u9f50\u6cb3\u4e00\u4e2d.cn\/blog\/index.php\/2026\/04\/09\/%e5%b7%ae%e5%88%86\/","title":{"rendered":"\u5dee\u5206"},"content":{"rendered":"\n<p>\u4f8b\u9898: <a href=\"https:\/\/www.luogu.com.cn\/problem\/P2367\">https:\/\/www.luogu.com.cn\/problem\/P2367<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\n#include &lt;cmath&gt;\n#include &lt;algorithm&gt;\n#include &lt;vector&gt;\n#include &lt;string&gt;\n#include &lt;climits&gt;\n\nusing namespace std;\ntypedef long long ll;\nint n, p, s&#91;6000000], c&#91;6000000], ans=INT_MAX;\n\nint main(){\n    ios::sync_with_stdio(false);\n    cin.tie(nullptr);\n\t\n\tcin &gt;&gt; n &gt;&gt; p;\n\tfor (int i=1;i&lt;=n;i++) {\n\t\tcin &gt;&gt; s&#91;i];\n\t}\n\tfor (int i=1;i&lt;=n;i++) {\n\t\tc&#91;i] = s&#91;i] - s&#91;i-1];\n\t}\n\t\n\tfor (int i=1;i&lt;=p;i++) {\n\t\tint x, y, z;\n\t\tcin &gt;&gt; x &gt;&gt; y &gt;&gt; z;\n\t\tc&#91;x] += z;\n\t\tc&#91;y + 1] -= z;\n\t}\n\t\n\tfor (int i=1;i&lt;=n;i++) {\n\t\ts&#91;i] = s&#91;i-1] + c&#91;i];\n\t\tans = min(ans, s&#91;i]);\n\t}\n\t\n\tcout &lt;&lt; ans;\n\t\n    return 0;\n}<\/code><\/pre>\n\n\n\n<p>\u4e8c\u4f4d\u5dee\u5206(<strong>\u5bb9\u65a5\u539f\u7406<\/strong>)<\/p>\n\n\n\n<p>\u4f8b\u9898: <a href=\"https:\/\/www.luogu.com.cn\/problem\/P3397\">https:\/\/www.luogu.com.cn\/problem\/P3397<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream>\n#include &lt;cmath>\n#include &lt;algorithm>\n#include &lt;vector>\n#include &lt;string>\n#include &lt;climits>\n\nusing namespace std;\ntypedef long long ll;\nint n, m, c&#91;2000]&#91;2000], ans=INT_MAX;\n\n\/\/ P3397\nint main(){\n    \/\/ ios::sync_with_stdio(false);\n    \/\/ cin.tie(nullptr);\n\t\n\tcin >> n >> m;\n\n\tfor (int i=1;i&lt;=m;i++) {\n\t\tint x1, y1, x2, y2;\n\t\tcin >> x1 >> y1 >> x2 >> y2;\n\t\t\n\t\tc&#91;x1]&#91;y1]++;\n\t\tc&#91;x2+1]&#91;y1]--;\n\t\tc&#91;x1]&#91;y2+1]--;\n\t\tc&#91;x2+1]&#91;y2+1]++;\n\t}\n\tfor (int i=1;i&lt;=n;i++) {\n\t\tfor (int j=1;j&lt;=n;j++) {\n\t\t\tc&#91;i]&#91;j] += c&#91;i-1]&#91;j] + c&#91;i]&#91;j-1] - c&#91;i-1]&#91;j-1];\n\t\t\tcout &lt;&lt; c&#91;i]&#91;j] &lt;&lt; \" \";\n\t\t}\n\t\tcout &lt;&lt; endl;\n\t}\n    return 0;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4f8b\u9898: https:\/\/www&#8230;<\/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":[],"class_list":["post-118","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/\u9f50\u6cb3\u4e00\u4e2d.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts\/118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/\u9f50\u6cb3\u4e00\u4e2d.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/\u9f50\u6cb3\u4e00\u4e2d.cn\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/\u9f50\u6cb3\u4e00\u4e2d.cn\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/\u9f50\u6cb3\u4e00\u4e2d.cn\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=118"}],"version-history":[{"count":3,"href":"https:\/\/\u9f50\u6cb3\u4e00\u4e2d.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts\/118\/revisions"}],"predecessor-version":[{"id":121,"href":"https:\/\/\u9f50\u6cb3\u4e00\u4e2d.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts\/118\/revisions\/121"}],"wp:attachment":[{"href":"https:\/\/\u9f50\u6cb3\u4e00\u4e2d.cn\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/\u9f50\u6cb3\u4e00\u4e2d.cn\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/\u9f50\u6cb3\u4e00\u4e2d.cn\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}