{"id":723,"date":"2019-10-08T14:12:36","date_gmt":"2019-10-08T06:12:36","guid":{"rendered":"http:\/\/fankasy.xyz\/?p=723"},"modified":"2019-11-13T12:30:45","modified_gmt":"2019-11-13T04:30:45","slug":"noj1031-%e5%bb%ba%e7%ad%91%e7%be%a4%e6%9c%80%e9%95%bf%e5%9d%a1%e5%80%bc","status":"publish","type":"post","link":"http:\/\/fankasy.xyz\/index.php\/2019\/10\/08\/noj1031-%e5%bb%ba%e7%ad%91%e7%be%a4%e6%9c%80%e9%95%bf%e5%9d%a1%e5%80%bc\/","title":{"rendered":"NOJ1031 \u5efa\u7b51\u7fa4\u6700\u957f\u5761\u503c"},"content":{"rendered":"\n<p>\u8fd9\u6b21\u63a5\u89e6\u5230\u4e86\u4ece\u672a\u63a5\u89e6\u8fc7\u7684\u7b97\u6cd5\u3002\u62dc\u5176\u6240\u8d50\uff0c\u5b66\u4e60\u4e86\u4e00\u4e9b\u6709\u5173\u52a8\u6001\u89c4\u5212\u7684\u77e5\u8bc6\u3002\u8fd9\u4e9b\u5c06\u5728\u5176\u4ed6\u6587\u7ae0\u91cc\u5199\u3002\u672c\u9898\u7528\u5230\u7684\u5c31\u662f\u7ebf\u6027\u52a8\u6001\u89c4\u5212\uff08\u7b80\u79f0dp\uff09<\/p>\n\n\n\n<p>\u53c2\u8003\u7528\uff1a<a href=\"https:\/\/blog.csdn.net\/weixin_42430270\/article\/details\/80727227\">https:\/\/blog.csdn.net\/weixin_42430270\/article\/details\/80727227<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream>\n#include &lt;algorithm>\nusing namespace std;\nint main()\n{\n    int n, ans = -1;\n    cin >> n;\n    int* h = new int[n];\n    int* dp = new int[n];\n    for (int i = 0; i &lt; n; i++)\n    {\n        cin >> h[i];\n        dp[i] = 1;\n    }\n    for (int i = 0; i &lt; n; i++)\n        for (int k = 0; k &lt; i; k++)\n            if (h[k] > h[i])\n                dp[i] = dp[k] + 1 > dp[i] ? dp[k] + 1 : dp[i];      \/\/\u72b6\u6001\u8f6c\u79fb\u65b9\u7a0b\n    for (int i = 0; i &lt; n; i++)\n        ans = max(ans, dp[i]);\n    delete[] h;\n    delete[] dp;\n    cout &lt;&lt; ans;\n    return 0;\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><br><\/h2>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u6b21\u63a5\u89e6\u5230\u4e86\u4ece\u672a\u63a5\u89e6\u8fc7\u7684\u7b97\u6cd5\u3002\u62dc\u5176\u6240\u8d50\uff0c\u5b66\u4e60\u4e86\u4e00\u4e9b\u6709\u5173\u52a8\u6001\u89c4\u5212\u7684\u77e5\u8bc6\u3002\u8fd9\u4e9b\u5c06\u5728\u5176\u4ed6\u6587\u7ae0\u91cc\u5199\u3002\u672c\u9898\u7528\u5230\u7684\u5c31\u662f\u7ebf\u6027 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[17],"tags":[],"_links":{"self":[{"href":"http:\/\/fankasy.xyz\/index.php\/wp-json\/wp\/v2\/posts\/723"}],"collection":[{"href":"http:\/\/fankasy.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/fankasy.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/fankasy.xyz\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/fankasy.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=723"}],"version-history":[{"count":0,"href":"http:\/\/fankasy.xyz\/index.php\/wp-json\/wp\/v2\/posts\/723\/revisions"}],"wp:attachment":[{"href":"http:\/\/fankasy.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=723"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/fankasy.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=723"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/fankasy.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=723"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}