{"id":206,"date":"2018-10-23T19:11:22","date_gmt":"2018-10-23T11:11:22","guid":{"rendered":"http:\/\/SmokeyDays.top\/wordpress\/?p=206"},"modified":"2018-11-09T07:30:23","modified_gmt":"2018-11-08T23:30:23","slug":"lp1199-%e4%b8%89%e5%9b%bd%e6%b8%b8%e6%88%8f","status":"publish","type":"post","link":"http:\/\/SmokeyDays.top\/wordpress\/2018\/10\/23\/lp1199-%e4%b8%89%e5%9b%bd%e6%b8%b8%e6%88%8f\/","title":{"rendered":"lp1199 NOIP2009 \u4e09\u56fd\u6e38\u620f"},"content":{"rendered":"<p>\u9996\u5148\u6211\u4eec\u5b9a\u4e49\u6700\u4f18\u914d\u5bf9\uff1a\u6700\u4f18\u914d\u5bf9\u6307\u7684\u662f\uff0c\u5bf9\u4e8e\u4e00\u4e2a\u6b66\u5c06\u800c\u8a00\uff0c\u4e0e\u4ed6\u9ed8\u5951\u503c\u6700\u9ad8\u7684\u6b66\u5c06\u3002<br \/>\n\u5176\u6b21\u6211\u4eec\u5b9a\u4e49\u6b21\u4f18\u914d\u5bf9\uff0c\u6b21\u4f18\u914d\u5bf9\u6307\u7684\u662f\uff0c\u5bf9\u4e8e\u4e00\u4e2a\u6b66\u5c06\u800c\u8a00\uff0c\u4e0e\u4ed6\u9ed8\u5951\u503c\u6b21\u9ad8\u7684\u6b66\u5c06\u3002<br \/>\n\u90a3\u4e48\u6211\u4eec\u77e5\u9053\uff0c\u65e0\u8bba\u5982\u4f55\uff0c\u4eba\u7c7b\u80fd\u591f\u9009\u53d6\u7684\u4e00\u5b9a\u53ea\u80fd\u662f\u4e00\u7ec4\u6b21\u4f18\u914d\u5bf9\uff0c\u800c\u4e0d\u53ef\u80fd\u662f\u4e00\u7ec4\u6700\u4f18\u914d\u5bf9\u3002<br \/>\n\u5f53\u7136\u4eba\u7c7b\u4e00\u5b9a\u53ef\u4ee5\u53d6\u5230\u6b21\u4f18\u914d\u5bf9\u4e2d\u7684\u6700\u5927\u503c\u3002\u8fd9\u662f\u56e0\u4e3a\u7535\u8111\u7684\u64cd\u4f5c\u4e00\u5b9a\u4f1a\u7528\u4e8e\u7834\u574f\u4eba\u7c7b\u53d6\u5230\u6700\u4f18\u914d\u5bf9\uff0c\u56e0\u6b64\u53d6\u5230\u6b21\u4f18\u914d\u5bf9\u4e00\u5b9a\u662f\u53ef\u80fd\u7684\u3002<br \/>\n\u5982\u679c\u4eba\u7c7b\u60f3\u8981\u80dc\u5229\uff0c\u5c31\u5fc5\u987b\u9632\u6b62\u7535\u8111\u53d6\u5230\u6700\u4f18\u914d\u5bf9\u4e2d\u6bd4\u6b21\u4f18\u914d\u5bf9\u6700\u5927\u503c\u66f4\u5927\u7684\u90a3\u4e9b\u503c\u3002\u6211\u4eec\u5b9a\u4e49\u8fd9\u6837\u7684\u503c\u4e3a\u300c\u5371\u9669\u503c\u300d<br \/>\n\u5982\u679c\u5371\u9669\u503c\u5b58\u5728\uff0c\u90a3\u4e48\u7ec4\u6210\u5b83\u7684\u4e24\u4e2a\u90e8\u5206\u4e00\u5b9a\u90fd\u4e92\u4e3a\u6700\u4f18\u914d\u5bf9\uff1a\u8bc1\u660e\u5982\u4e0b\u3002<br \/>\n\u5982\u679c\u7ec4\u6210\u5371\u9669\u503c\u7684\u4e24\u4e2a\u90e8\u5206\u4e0d\u4e92\u4e3a\u6700\u4f18\u914d\u5bf9\uff0c\u90a3\u4e48\u5371\u9669\u503c\u4e00\u5b9a\u662f\u4e24\u8005\u4e2d\u4e00\u8005\u5173\u4e8e\u53e6\u4e00\u8005\u7684\u6700\u4f18\u914d\u5bf9\u3002<br \/>\n\u6211\u4eec\u4e0d\u59a8\u8bbe\u5b9a\u7532\u6b66\u5c06\u662f\u4e59\u7684\u6700\u4f18\u914d\u5bf9\uff0c\u8be5\u914d\u5bf9\u662f\u5371\u9669\u503c\uff0c\u90a3\u4e48\u4e59\u6b66\u5c06\u5fc5\u987b\u5b58\u5728\u4e00\u4e2a\u6700\u4f18\u914d\u5bf9\uff0c\u4f7f\u5f97\u8be5\u914d\u5bf9\u7684\u503c\u5927\u4e8e\u5371\u9669\u503c\u3002<br \/>\n\u8fd9\u65f6\u5019\u4e59\u6b66\u5c06\u7684\u6b21\u4f18\u914d\u5bf9\u4e00\u5b9a\u5927\u4e8e\u7b49\u4e8e\u5371\u9669\u503c\uff0c\u4f46\u662f\u8fd9\u4e0e\u5371\u9669\u503c\u7684\u5b9a\u4e49\u77db\u76fe\u3002\u6240\u4ee5\u7ec4\u6210\u5371\u9669\u503c\u7684\u4e24\u4e2a\u90e8\u5206\u4e00\u5b9a\u4e92\u4e3a\u6700\u4f18\u914d\u5bf9\u3002<br \/>\n\u6545\u800c\uff0c\u6211\u4eec\u53d1\u73b0\uff0c\u5371\u9669\u503c\u4e00\u5b9a\u662f\u4e00\u79cd\u6700\u4f18\u914d\u5bf9\u3002<br \/>\n\u90a3\u4e48\uff0c\u5f53\u6211\u4eec\u4f18\u5148\u53d6\u5f97\u8db3\u4ee5\u6784\u6210\u6b21\u4f18\u914d\u5bf9\u4e2d\u7684\u6700\u5927\u503c\u7684\u4e24\u4e2a\u6b66\u5c06\u4ee5\u540e\uff0c\u7535\u8111\u5df2\u7ecf\u63a7\u5236\u7684\u4e00\u4e2a\u6b66\u5c06\u603b\u662f\u4e0d\u80fd\u6784\u6210\u5371\u9669\u503c\u3002<br \/>\n\u8fd9\u662f\u56e0\u4e3a\u7ec4\u6210\u5371\u9669\u503c\u7684\u4e24\u4e2a\u6b66\u5c06\u4e00\u5b9a\u4e92\u4e3a\u6700\u4f18\u914d\u5bf9\uff0c\u800c\u7535\u8111\u5df2\u7ecf\u63a7\u5236\u7684\u4ec5\u4e3a\u5176\u4e2d\u7684\u4e00\u4e2a\u6b66\u5c06\uff0c\u5e76\u4e14\u4e0e\u8be5\u6b66\u5c06\u6784\u6210\u6700\u4f18\u914d\u5bf9\u7684\u6b66\u5c06\u63a7\u5236\u5728\u73a9\u5bb6\u624b\u4e2d\u3002<br \/>\n\u5f53\u6e38\u620f\u8fdb\u884c\u4e09\u6b65\u65f6\uff0c\u73a9\u5bb6\u5df2\u7ecf\u63a7\u5236\u4e86\u6b21\u4f18\u914d\u5bf9\u4e2d\u7684\u6700\u5927\u503c\uff0c\u5e76\u4e14\u7535\u8111\u4e0d\u63a7\u5236\u4efb\u4f55\u5371\u9669\u503c\uff0c\u6b64\u65f6\u53ef\u4ee5\u5c06\u6e38\u620f\u8f6c\u5316\u4e3a<br \/>\n\u300c\u7535\u8111\u5148\u624b\u4e14\u5fc5\u987b\u63a7\u5236\u5371\u9669\u503c\u300d\u7684\u60c5\u51b5\u3002<br \/>\n\u7531\u4e8e\u5371\u9669\u503c\u603b\u662f\u9700\u8981\u7531\u4e00\u7ec4\u4e92\u4e3a\u6700\u4f18\u914d\u5bf9\u7684\u6b66\u5c06\u6784\u6210\uff0c\u5bb9\u6613\u8bc1\u660e\u65e0\u8bba\u7535\u8111\u5982\u4f55\u9009\u62e9\uff0c\u73a9\u5bb6\u90fd\u53ef\u4ee5\u7834\u574f\u5371\u9669\u503c\u7684\u6784\u6210\u3002<br \/>\n\u56e0\u6b64\uff0c\u603b\u662f\u6709\u89e3\uff0c\u4e14\u89e3\u603b\u4e3a\u6b21\u4f18\u914d\u5bf9\u4e2d\u7684\u6700\u5927\u503c\u3002<\/p>\n<p>\u5f53\u7136\u8fd9\u4e00\u9898\u8fd8\u6709\u4e00\u4e2a\u5b9e\u73b0\u96be\u70b9\u5728\u4e8e\u8bfb\u5165\uff0c\u8fd9\u91cc\u5c31\u4e0d\u518d\u7ec6\u8bf4\u3002<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"cpp\">#include&lt;iostream&gt;\r\n#include&lt;cstdio&gt;\r\nusing namespace std;\r\n#define Max(_A,_B) ((_A)&gt;(_B)?(_A):(_B))\r\n\/*\r\nlp1199 \u4e09\u56fd\u6e38\u620f\r\n*\/\r\nint n,f[505][505];\r\nvoid init(){\r\n    scanf(\"%d\",&amp;n);\r\n    int mx,lmx,ans=0,x;\r\n    for(int i=1;i&lt;n;++i){\r\n        for(int j=i+1;j&lt;=n;++j){\r\n            scanf(\"%d\",&amp;f[i][j]);\r\n            f[j][i]=f[i][j];\r\n        }\r\n    }\r\n    \/*\r\n    for(int i=1;i&lt;n;++i){\r\n        for(int j=1;j&lt;n;++j){\r\n            printf(\"%d \",f[i][j]);\r\n        }\r\n        puts(\"\");\r\n    }\r\n    *\/\r\n    for(int i=1;i&lt;=n;++i){\r\n        mx=0,lmx=0;\r\n        for(int j=1;j&lt;=n;++j){\r\n            x=f[i][j];\r\n            if(mx&lt;x){\r\n                lmx=mx;\r\n                mx=x;\r\n            }else{\r\n                lmx=Max(lmx,x);\r\n            }\r\n        }\r\n        ans=Max(ans,lmx);\r\n    }\r\n    puts(\"1\");\r\n    printf(\"%d\",ans);\r\n}\r\nint main(){\r\n    init();\r\n    return 0;\r\n}<\/code><\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148\u6211\u4eec\u5b9a\u4e49\u6700\u4f18\u914d\u5bf9\uff1a\u6700\u4f18\u914d\u5bf9\u6307\u7684\u662f\uff0c\u5bf9\u4e8e\u4e00\u4e2a\u6b66\u5c06\u800c\u8a00\uff0c\u4e0e\u4ed6\u9ed8\u5951\u503c\u6700\u9ad8\u7684\u6b66\u5c06\u3002 \u5176\u6b21\u6211\u4eec\u5b9a\u4e49\u6b21\u4f18\u914d\u5bf9\uff0c\u6b21\u4f18\u914d\u5bf9 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/SmokeyDays.top\/wordpress\/2018\/10\/23\/lp1199-%e4%b8%89%e5%9b%bd%e6%b8%b8%e6%88%8f\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201clp1199 NOIP2009 \u4e09\u56fd\u6e38\u620f\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":262,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10,26,24,25,8,6,5],"tags":[],"_links":{"self":[{"href":"http:\/\/SmokeyDays.top\/wordpress\/wp-json\/wp\/v2\/posts\/206"}],"collection":[{"href":"http:\/\/SmokeyDays.top\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/SmokeyDays.top\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/SmokeyDays.top\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/SmokeyDays.top\/wordpress\/wp-json\/wp\/v2\/comments?post=206"}],"version-history":[{"count":2,"href":"http:\/\/SmokeyDays.top\/wordpress\/wp-json\/wp\/v2\/posts\/206\/revisions"}],"predecessor-version":[{"id":384,"href":"http:\/\/SmokeyDays.top\/wordpress\/wp-json\/wp\/v2\/posts\/206\/revisions\/384"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/SmokeyDays.top\/wordpress\/wp-json\/wp\/v2\/media\/262"}],"wp:attachment":[{"href":"http:\/\/SmokeyDays.top\/wordpress\/wp-json\/wp\/v2\/media?parent=206"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/SmokeyDays.top\/wordpress\/wp-json\/wp\/v2\/categories?post=206"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/SmokeyDays.top\/wordpress\/wp-json\/wp\/v2\/tags?post=206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}