{"id":223790,"date":"2012-05-13T19:47:07","date_gmt":"2012-05-13T11:47:07","guid":{"rendered":"http:\/\/blog.yangzhe1991.org\/?p=223790"},"modified":"2014-03-14T20:01:42","modified_gmt":"2014-03-14T12:01:42","slug":"%e6%a0%91%e7%8a%b6%e6%95%b0%e7%bb%84%e7%9a%84%e7%ac%ac%e4%ba%8c%e7%a7%8d%e7%94%a8%e6%b3%95","status":"publish","type":"post","link":"https:\/\/yangzhe1991.org\/blog\/2012\/05\/%e6%a0%91%e7%8a%b6%e6%95%b0%e7%bb%84%e7%9a%84%e7%ac%ac%e4%ba%8c%e7%a7%8d%e7%94%a8%e6%b3%95\/","title":{"rendered":"\u6811\u72b6\u6570\u7ec4\u7684\u7b2c\u4e8c\u79cd\u7528\u6cd5"},"content":{"rendered":"<p>\u6b63\u5e38\u7684\u8bdd\u6811\u72b6\u6570\u7ec4\u662f\u66f4\u65b0\u67d0\u4e2a\u70b9\u7684\u503c\u7136\u540e\u6c42\u4e00\u4e2a\u533a\u95f4\u7684\u548c\uff0c\u8fd9\u4e2a\u6bd4\u8f83\u76f4\u89c2\u4e5f\u6bd4\u8f83\u5e38\u7528\u3002\u6811\u72b6\u6570\u7ec4\u540c\u65f6\u4e5f\u53ef\u4ee5\u66f4\u65b0\u4e00\u4e2a\u533a\u95f4\u6c42\u4e00\u4e2a\u70b9\u7684\u503c\uff0c\u7136\u540e\u8fd9\u4e2a\u7684\u539f\u7406\u603b\u662f\u60f3\u4e0d\u8d77\u6765\u81ea\u5df1\u63a8\u5bfc\u4e5f\u641e\u4e0d\u660e\u767d\u67e5\u7f51\u4e0a\u7684\u8d44\u6599\u4e5f\u90fd\u4e0d\u662f\u5f88\u9760\u8c31\uff08\u5927\u90fd\u662f\u795e\u9a6c\u4fee\u6539\u4e86\u51fd\u6570\u4e8e\u662f\u4e0d\u65b9\u4fbf\u5171\u7528\u4e00\u4e2a\u6a21\u677f\u4e5f\u6ca1\u610f\u601d\u4e86\uff09\u4e8e\u662f\u8d81\u6211\u73b0\u5728\u80fd\u641e\u660e\u767d\u5199\u51fa\u6765\u8bb0\u5f55\u4e0b\u7b49\u4e0b\u6b21\u5fd8\u4e86\u7684\u65f6\u5019\u76f4\u63a5\u770b\u6211\u81ea\u5df1\u5199\u7684\u4e1c\u897f\u3002<\/p>\n<p><!--more--><\/p>\n<p>modify\u7406\u8bba\u4e0a\u662f\u66f4\u65b0\u67d0\u4e2a\u70b9\u7684\u503c\uff0csum\u662f\u6c421\u5230\u8fd9\u4e2a\u5e97\u7684\u548c\u3002<\/p>\n<p>\u7136\u540e\u5047\u5982\u6211\u60f3\u6bcf\u6b21\u66f4\u65b0[l,r]\u4e00\u4e2a\u533a\u95f4\u53ea\u6c42\u67d0\u4e2a\u70b9\u7684\u503c\u5c31\u5f97\u6bcf\u6b21\u66f4\u65b0\u82e5\u5e72\u4e2a\u70b9\u518dsum(x)-sum(x-1)\u3002<\/p>\n<p>\u4f46\u662f\u5047\u5982\u6211modify(l,k)\u7136\u540emodify(r+1,-k)\uff0c\u5c31\u4f1a\u5bfc\u81f4sum(l)\u5230sum(r)\u7684\u503c\u5747\u589e\u52a0\u4e86k\uff0c\u7136\u540e[1,l)\u548c(r,max)\u8fd9\u4e24\u4e2a\u8303\u56f4\u5185\u7684sum\u90fd\u4e0d\u53d8\u3002<\/p>\n<p>\u8fd9\u6837sum(x)\u5c31\u662fx\u8fd9\u4e2a\u70b9\u5f53\u524d\u7684\u503c\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6b63\u5e38\u7684\u8bdd\u6811\u72b6\u6570\u7ec4\u662f\u66f4\u65b0\u67d0\u4e2a\u70b9\u7684\u503c\u7136\u540e\u6c42\u4e00\u4e2a\u533a\u95f4\u7684\u548c\uff0c\u8fd9\u4e2a\u6bd4\u8f83\u76f4\u89c2\u4e5f\u6bd4\u8f83\u5e38\u7528\u3002\u6811\u72b6\u6570\u7ec4\u540c\u65f6\u4e5f\u53ef\u4ee5\u66f4\u65b0\u4e00\u4e2a\u533a\u95f4\u6c42\u4e00 [&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":[9],"_links":{"self":[{"href":"https:\/\/yangzhe1991.org\/blog\/wp-json\/wp\/v2\/posts\/223790"}],"collection":[{"href":"https:\/\/yangzhe1991.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yangzhe1991.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yangzhe1991.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yangzhe1991.org\/blog\/wp-json\/wp\/v2\/comments?post=223790"}],"version-history":[{"count":1,"href":"https:\/\/yangzhe1991.org\/blog\/wp-json\/wp\/v2\/posts\/223790\/revisions"}],"predecessor-version":[{"id":224643,"href":"https:\/\/yangzhe1991.org\/blog\/wp-json\/wp\/v2\/posts\/223790\/revisions\/224643"}],"wp:attachment":[{"href":"https:\/\/yangzhe1991.org\/blog\/wp-json\/wp\/v2\/media?parent=223790"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yangzhe1991.org\/blog\/wp-json\/wp\/v2\/categories?post=223790"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yangzhe1991.org\/blog\/wp-json\/wp\/v2\/tags?post=223790"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}