{"id":1043,"date":"2024-02-01T23:11:07","date_gmt":"2024-02-01T15:11:07","guid":{"rendered":"http:\/\/ggapa.net:81\/?p=1043"},"modified":"2024-02-06T16:01:07","modified_gmt":"2024-02-06T08:01:07","slug":"%e5%81%9a%e9%a2%98%e7%ac%94%e8%ae%b01","status":"publish","type":"post","link":"http:\/\/ggapa.net:81\/2024\/02\/01\/%e5%81%9a%e9%a2%98%e7%ac%94%e8%ae%b01\/","title":{"rendered":"\u505a\u9898\u7b14\u8bb0(\u6d1b\u8c37\u9898\u5355)"},"content":{"rendered":"
\u9898\u5355<\/a><\/p>\n \u9996\u5148\u770b\u9898\u76ee\u6570\u636e\u8303\u56f4\uff0c$n \\leq 100$ \uff0c\u8fd9\u79cd\u60c5\u51b5\u8981\u4e48\u8bf4\u660e\u8fd9\u9053\u9898\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u662f\u6bd4\u8f83\u9ad8\u7684\uff0c\u8981\u4e48\u5c31\u548c\u77e9\u9635\u4e58\u6cd5\u8131\u4e0d\u5f00\u5173\u7cfb\u3002<\/p>\n \u9605\u8bfb\u9898\u76ee\u4e4b\u540e\uff0c\u6211\u4eec\u53d1\u73b0\u53ef\u4ee5\u5e94\u7528 Floyd \u6700\u77ed\u8def\uff0c\u4e5f\u5c31\u662f\u77e9\u9635\u4e58\u6cd5\u7684\u601d\u60f3\u53bb\u63cf\u8ff0\u6bcf\u4e00\u8f6e\u6bcf\u4e00\u4e2a\u57ce\u5e02\u7684\u9b54\u6cd5\u503c\u3002<\/p>\n \u6545\u8fd9\u9053\u9898\u5e94\u8be5\u5148\u7528\u90bb\u63a5\u77e9\u9635\u5efa\u56fe\uff0c\u77e9\u9635\u5feb\u901f\u5e42\u6c42\u89e3\u3002<\/p>\n \u7ed3\u679c\u5c31\u8d85\u65f6\u4e86\uff0c\u8003\u8651\u901a\u8fc7\u500d\u589e\uff0c\u4e8c\u8fdb\u5236\u5206\u89e3\u4f18\u5316\u3002<\/p>\n \u9884\u5904\u7406\u65f6\u95f4\u590d\u6742\u5ea6 $O(n^3\\log n)$ \uff0c\u5355\u6b21\u8be2\u95ee\u65f6\u95f4\u590d\u6742\u5ea6 $O(n^2\\log n)$ \u3002<\/p>\n \u603b\u7ed3\uff1a\u5bf9\u4e8e\u6570\u636e\u8303\u56f4\u6bd4\u8f83\u5c0f\u7684\u56fe\u8bba\u9898\u8981\u8054\u60f3\u5230\u90bb\u63a5\u77e9\u9635\uff0c\u5bf9\u4e8e\u7ecf\u5e38\u4f1a\u7528\u5230\u7684\u6570\u636e\u4e0d\u5fc5\u91cd\u590d\u8ba1\u7b97\uff0c\u8003\u8651\u8bb0\u5f55\u4e0b\u6765\u4f18\u5316\u7a0b\u5e8f\u7684\u8fd0\u884c\u6548\u7387\u3002<\/p>\n \u8bd5\u7740\u7531\u6613\u5230\u96be\uff0c\u4e00\u6b65\u4e00\u6b65\u5206\u6790\u3002<\/p>\n \u5bf9\u4e8e $k = 1$ \u7684\u60c5\u51b5\uff0c\u7b54\u6848\u5c31\u662f\u4e24\u70b9\u4e4b\u95f4\u7684\u7b80\u5355\u8def\u5f84\uff0c\u8003\u8651\u901a\u8fc7\u6811\u94fe\u5256\u5206\u5b9e\u73b0\u3002\u65f6\u95f4\u590d\u6742\u5ea6 $O(n \\log n)$<\/p>\n \u5bf9\u4e8e $n \\leq 200 $\u65f6\uff0c\u53ef\u4ee5\u8003\u8651\u5bf9\u4e8e\u6bcf\u4e00\u4e2a\u8282\u70b9\uff0c\u8ddd\u79bb\u4e0d\u8d85\u8fc7 $k$ \u7684\u70b9\u8fde\u65e0\u5411\u8fb9\uff0c\u5bf9\u4e8e\u6bcf\u4e00\u6b21\u8be2\u95ee\u8dd1\u6700\u77ed\u8def\uff0c\u65f6\u95f4\u590d\u6742\u5ea6 $O(q\\cdot n^2\\log n)$\u3002<\/p>\n \u8fd9\u4e2a\u7279\u6b8a\u6027\u8d28\u975e\u5e38\u7684\u7384\u5b66\uff0c\u4e0d\u77e5\u9053\u662f\u7ed9\u4ec0\u4e48\u7b97\u6cd5\u7684\uff0c \u63a5\u7740\u5206\u6790 $k = 2$ \u7684\u60c5\u51b5\uff0c\u989d\u3002<\/p>\n \u770b\u5230\u9898\u76ee\u548c\u6570\u636e\u8303\u56f4\u540e\uff0c\u4e0d\u96be\u60f3\u5230\u77e9\u9635\u5feb\u901f\u5e42\u6c42\u89e3 $k$ \u6b65\u5185\u5230\u8fbe\u67d0\u4e00\u7ed3\u70b9\u7684\u65b9\u6848\u6570\u8fd9\u4e00\u7c7b\u95ee\u9898\u3002<\/p>\n \u4f46\u662f\u95ee\u9898\u51fa\u73b0\u4e86\uff0c\u56e0\u4e3a\u4e0a\u8ff0\u505a\u6cd5\u53ea\u80fd\u6ee1\u8db3 "01\u77e9\u9635"\u3002<\/p>\n \u90a3\u6211\u4eec\u5c31\u8003\u8651\u5c06\u8fd9\u4e2a\u77e9\u9635\u8f6c\u5316\u4e3a 01\u77e9\u9635\u4e0d\u4e45\u5b8c\u4e8b\u4e86\u5417\uff1f<\/p>\n \u8003\u8651\u7ed9\u6bcf\u4e2a\u8282\u70b9\u5efa\u7acb 8 \u4e2a\u865a\u70b9\uff0c\u6211\u4eec\u4ee4 $(i,j)$ \u8868\u793a\u8ddd\u79bb\u8282\u70b9 $i$\uff0c$j$ \u4e2a\u8ddd\u79bb\u7684\u70b9\uff0c$(i,0)$ \u5c31\u4ee3\u8868\u8282\u70b9 $i$\uff0c\u6211\u4eec\u9700\u8981\u5c06 $(i, j)$ \u548c $(i, j-1 )$ \u901a\u8fc7\u4e00\u6761\u6709\u5411\u8fb9\u8fde\u63a5\u8d77\u6765\u3002<\/p>\n \u82e5\u6b64\u65f6\u6709\u8fb9\u8fde\u5411\u8fd9\u4e2a\u8282\u70b9\uff0c\u4e14\u8ddd\u79bb\u4e3a $d$\uff0c\u90a3\u4e48\u6211\u4eec\u5c31\u5c06\u5b83\u8fde\u63a5\u5230 $(i, d - 1)$ \u7684\u8282\u70b9\u5904\u5c31\u53ef\u4ee5\u4e86\uff0c\u6b64\u65f6\u8fd9\u4e2a\u90bb\u63a5\u77e9\u9635\u5c31\u8f6c\u5316\u4e3a\u4e86 01 \u77e9\u9635\u3002<\/p>\n \u65f6\u95f4\u590d\u6742\u5ea6\uff1a$O((9n)^3 \\log T)$<\/p>\n \u603b\u7ed3\uff1a\u5982\u679c\u4e00\u9053\u9898\u76ee\u662f\u67d0\u7c7b\u9898\u578b\u7684\u53d8\u79cd\uff0c\u90a3\u6211\u4eec\u53ef\u4ee5\u5c06\u8fd9\u9053\u9898\u60f3\u529e\u6cd5\u8f6c\u5316\u4e3a\u6211\u4eec\u719f\u6089\u7684\u9898\u578b\uff1b<\/p>\n \u7b80\u5355\u9898\u3002<\/p>\n \u4e00\u773c\u53ef\u4ee5\u770b\u51fa\u8fd9\u662f\u4e00\u4e2a\u8fde\u7eed\u6bb5\u95ee\u9898\uff0c\u8003\u8651\u901a\u8fc7\u7ebf\u6bb5\u6811\u89e3\u51b3\u3002<\/p>\n \u6211\u4eec\u9700\u8981\u7ef4\u62a4\u4ee5\u4e0b\u4fe1\u606f\uff1a<\/p>\n \u8f6c\u79fb\u548c\u533a\u95f4\u6700\u957f\u5b50\u5e8f\u5217\u8f6c\u79fb\u7684\u601d\u60f3\u5dee\u4e0d\u591a\uff0c\u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0c\u9898\u76ee\u4e2d\u8981\u6c42\u662f\u6700\u9760\u5de6\u4fa7\u7684\uff0c\u90a3\u4e48\u5728\u67e5\u8be2\u7684\u65f6\u5019\u9700\u8981\u6709\u9650\u9012\u5f52\u5de6\u513f\u5b50\uff0c\u63a5\u7740\u662f\u5de6\u513f\u5b50\u548c\u53f3\u513f\u5b50\uff0c\u6700\u540e\u624d\u662f\u53f3\u513f\u5b50\u3002<\/p>\n \u5176\u4f59\u64cd\u4f5c\u548c\u666e\u901a\u7ebf\u6bb5\u6811\u65e0\u5f02\u3002<\/p>\n \u8fd9\u9053\u9898\u6bd4\u8f83\u91cd\u89c6\u601d\u7ef4\uff0c\u89c2\u5bdf\u6570\u636e\u8303\u56f4\uff0c\u5f88\u660e\u663e\u662f\u8981\u8ba9\u6211\u4eec\u5148\u9884\u5904\u7406\uff0c\u63a5\u7740\u4ee5\u6bd4\u8f83\u5c0f\u7684\u590d\u6742\u5ea6\u8fdb\u884c\u67e5\u8be2\u3002<\/p>\n \u8003\u8651\u5982\u4f55\u9884\u5904\u7406\uff0c\u901a\u8fc7\u624b\u63a8\u6837\u4f8b\u53ef\u4ee5\u53d1\u73b0\uff0c\u5982\u679c\u4e00\u4e2a\u4e8c\u5143\u7ec4\u662f\u6210\u529f\u7684\uff0c\u90a3\u4e48\u5b83\u4e00\u5b9a\u80fd\u5c06\u4e0a\u4e00\u4e2a\u6210\u529f\u7684\u4e8c\u5143\u7ec4\u5f39\u51fa\uff0c\u800c\u4e14\u4e00\u4e2a\u4e8c\u5143\u7ec4\u53ea\u53ef\u80fd\u88ab\u4e00\u4e2a\u7279\u5b9a\u7684\u4e8c\u5143\u7ec4\u7ed9\u5f39\u51fa\u3002<\/p>\n \u90a3\u4e48\u5c31\u53ef\u4ee5\u901a\u8fc7\u6808\u6765\u7ef4\u62a4\u6bcf\u4e00\u4e2a\u4e8c\u5143\u7ec4\u662f\u7531\u8c01\u5c06\u5b83\u5f39\u51fa\u53bb\u7684\u3002<\/p>\n \u65f6\u95f4\u590d\u6742\u5ea6\uff1a$O(n)$<\/p>\n \u7531\u4e8e\u9884\u5904\u7406\u5df2\u7ecf\u82b1\u8d39\u4e86 $O(n)$ \u7684\u65f6\u95f4\uff0c\u67e5\u8be2\u64cd\u4f5c\u88ab\u538b\u69a8\u6210\u4e86 $\\log$ \u7ea7\u6216\u8005\u662f\u5e38\u6570\u7ea7\u3002<\/p>\n \u7531\u4e4b\u524d\u7684\u603b\u7ed3\u53ef\u4ee5\u77e5\u9053\uff0c\u5bf9\u4e8e\u53ef\u80fd\u4f1a\u91cd\u590d\u7528\u5230\u7684\u6570\u636e\uff0c\u6211\u4eec\u8003\u8651\u901a\u8fc7\u500d\u589e\u8fdb\u884c\u4f18\u5316\uff0c\u8fd9\u6837\u67e5\u8be2\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u5c31\u53d8\u4e3a\u4e86 $O(\\log n)$ \uff0c\u53ef\u4ee5\u901a\u8fc7\u672c\u9898\u3002<\/p>\n \u603b\u7ed3\uff1a\u5bf9\u4e8e\u4e00\u4e2a\u6570\u636e\u8303\u56f4\u6bd4\u8f83\u5927\u7684\u9898\uff0c\u5b83\u7684\u6700\u5927\u65f6\u95f4\u590d\u6742\u5ea6\u4e00\u822c\u4e0d\u4f1a\u8d85\u8fc7 $O(n)$\uff0c\u82e5\u6b64\u65f6\u7684\u8be2\u95ee\u6b21\u6570\u4e5f\u975e\u5e38\u591a\u5c31\u9700\u8981\u8003\u8651\u9884\u5904\u7406\uff1b\u82e5\u4e00\u9053\u9898\u76ee\u4e2d\uff0c\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u4ed6\u53eb\u4f60\u627e\u7684\u7279\u6b8a\u7684\u4e1c\u897f\uff0c\u5c0f\u4e8e\u666e\u901a\u7684\u4e1c\u897f\uff0c\u90a3\u4e48\u8fd9\u4e2a\u65f6\u5019\u5c31\u53ef\u4ee5\u8003\u8651\u76f4\u63a5\u4ece\u7279\u6b8a\u7684\u4e1c\u897f\u5165\u624b\uff08\u51fa\u73b0\u6b21\u6570\u6bd4\u8f83\u5c11\u7684\u5165\u624b\uff09\uff0c\u5f31\u5316\u5728\u666e\u901a\u7684\u4e1c\u897f\u4e0a\u9762\u6240\u82b1\u8d39\u7684\u65f6\u95f4\u3002<\/p>\n \u9898\u5355<\/a><\/p>\n \u770b\u5230\u9898\u76ee\uff0c\u4e0d\u96be\u60f3\u5230\u8bb0\u5fc6\u5316\u641c\u7d22\u3002<\/p>\n \u7c7b\u6bd4\u666e\u901a\u7684\u62ec\u53f7\u5e8f\u5217\u8bb0\u5fc6\u5316\u641c\u7d22\uff0c\u8fd9\u9053\u9898\u76ee\u975e\u5e38\u826f\u5fc3\uff0c\u5df2\u7ecf\u5e2e\u6211\u4eec\u628a\u6240\u6709\u7684\u60c5\u51b5\u90fd\u6446\u4e86\u51fa\u6765\uff0c\u90a3\u4e48\u6211\u4eec\u5c31\u8003\u8651\u5bf9\u8fd9\u4e9b\u60c5\u51b5\u8fdb\u884c\u8003\u8651\u5c31\u8db3\u591f\u4e86\u3002<\/p>\n \u8fc5\u901f\u6253\u5b8c\u8bb0\u5fc6\u5316\uff0c\u53d1\u73b0\u7b54\u6848\u83ab\u540d\u5176\u5999\u975e\u5e38\u5927\uff0c\u53d1\u73b0\u8fb9\u754c\u6761\u4ef6\u5224\u65ad\u6f0f\uff0c\u5bc4\u4e86\u3002<\/p>\n \u603b\u7ed3\uff1a\u82e5\u8bb0\u5fc6\u5316\u641c\u7d22\u8fd4\u56de\u7684\u7ed3\u679c\u5f88\u5927\uff0c\u6709\u53ef\u80fd\u65f6\u8fb9\u754c\u6761\u4ef6\u6ca1\u6709\u5224\u65ad\u6e05\u695a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" \u6570\u636e\u7ed3\u6784\uff08\u7ebf\u6bb5\u6811\u4e3a\u4e3b\uff09 \u9898\u5355 P6569 [NOI Online #3 \u63d0\u9ad8\u7ec4] \u9b54\u6cd5\u503c \u9996\u5148\u770b\u9898\u76ee\u6570\u636e\u8303\u56f4\uff0c […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[33,20],"_links":{"self":[{"href":"http:\/\/ggapa.net:81\/wp-json\/wp\/v2\/posts\/1043"}],"collection":[{"href":"http:\/\/ggapa.net:81\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ggapa.net:81\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ggapa.net:81\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/ggapa.net:81\/wp-json\/wp\/v2\/comments?post=1043"}],"version-history":[{"count":6,"href":"http:\/\/ggapa.net:81\/wp-json\/wp\/v2\/posts\/1043\/revisions"}],"predecessor-version":[{"id":1077,"href":"http:\/\/ggapa.net:81\/wp-json\/wp\/v2\/posts\/1043\/revisions\/1077"}],"wp:attachment":[{"href":"http:\/\/ggapa.net:81\/wp-json\/wp\/v2\/media?parent=1043"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ggapa.net:81\/wp-json\/wp\/v2\/categories?post=1043"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ggapa.net:81\/wp-json\/wp\/v2\/tags?post=1043"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}P6569 [NOI Online #3 \u63d0\u9ad8\u7ec4] \u9b54\u6cd5\u503c<\/a><\/h3>\n
P8820 [CSP-S 2022] \u6570\u636e\u4f20\u8f93<\/a><\/h3>\n
\u8fd9\u90fd\u4e0d\u77e5\u9053\uff0c\u6211\u592a\u83dc\u4e86<\/del>\u3002<\/p>\nP4159 [SCOI2009] \u8ff7\u8def<\/a><\/h3>\n
P2894 [USACO08FEB] Hotel G<\/a><\/h3>\n
\n
perl<\/code> \u5de6\u7aef\u70b9\u5f00\u59cb\u7684\u8fde\u7eed\u7a7a\u623f\u95f4\u4e2a\u6570<\/p>\n<\/li>\n
perr<\/code> \u53f3\u7aef\u70b9\u5f00\u59cb\u7684\u8fde\u7eed\u7a7a\u623f\u95f4\u4e2a\u6570<\/p>\n<\/li>\n
mx<\/code> \u533a\u95f4\u5185\u6700\u957f\u7684\u8fde\u7eed\u7a7a\u623f\u95f4\u4e2a\u6570<\/p>\n<\/li>\n<\/ul>\n
P8251 [NOI Online 2022 \u63d0\u9ad8\u7ec4] \u4e39\u9493\u6218<\/a><\/h3>\n
\n\u62ec\u53f7\u5e8f\u5217<\/h1>\n
P7914 [CSP-S 2021] \u62ec\u53f7\u5e8f\u5217<\/a><\/h3>\n