{"id":30,"date":"2022-06-04T10:52:00","date_gmt":"2022-06-04T02:52:00","guid":{"rendered":"http:\/\/ubuntu.tim-wcx.ltd\/wordpress\/index.php\/2022\/06\/04\/2020-08-14\/"},"modified":"2022-06-04T10:52:00","modified_gmt":"2022-06-04T02:52:00","slug":"2020-08-14","status":"publish","type":"post","link":"https:\/\/wordpress.tim-wcx.ltd\/index.php\/2022\/06\/04\/2020-08-14\/","title":{"rendered":"2020-08-14"},"content":{"rendered":"<p><svg  style=\"display: none;\">\n                        <path stroke-linecap=\"round\" d=\"M5,0 0,2.5 5,5z\" id=\"raphael-marker-block\" style=\"-webkit-tap-highlight-color: rgba(0, 0, 0, 0);\"><\/path>\n                    <\/svg><\/p>\n<p><a href=\"http:\/\/icpc.upc.edu.cn\/problem.php?cid=2526&#038;pid=5\">http:\/\/icpc.upc.edu.cn\/problem.php?cid=2526&#038;pid=5<\/a><\/p>\n<h5><a id=\"_1\"><\/a>\u9898\u76ee\u63cf\u8ff0<\/h5>\n<p>\u5728\u66fe\u7ecf\u7684\u8bb2\u89e3\u4e2d\uff0c\u82b1\u548c\u4ed6\u7684\u5144\u5f1f\u59d0\u59b9\u4eec\u88ab\u8fd9\u4e2a\u53eb\u505a Yyx \u7684\u4eba\u6446\u6765\u6446\u53bb\uff0c\u5413\u5f97\u8033\u6735\u90fd\u778e\u4e86\uff0c\u5634\u5df4\u4e5f\u542c\u4e0d\u89c1\u4e86\u3002\u4e8e\u662f\u4ed6\u4eec\u51b3\u5b9a\u300c\u4ee5\u5176\u4eba\u4e4b\u9053\u8fd8\u6cbb\u5176\u4eba\u4e4b\u8eab\u300d\uff0c\u4ed6\u4eec\u628a Yyx, Kangkang, Michael \u7b49\u4eba\u6446\u6210\u4e00\u6392\uff0c\u8fd9\u4e2a\u65f6\u5019\uff0c\u82b1\u8bf4\u9053\uff1a\u300c\u4f60\u4eec\u7684\u8eab\u9ad8\u592a\u4e0d\u548c\u8c10\u4e86\uff0c\u53ea\u6709\u6ee1\u8db3\u6211\u7684\u8981\u6c42\u7684\u4eba\u624d\u80fd\u7559\u4e0b\uff0c\u5176\u4ed6\u4eba\u90fd\u53bb\u5f53\u82b1\u3002\u300d\u800c Yyx \u60f3\u7559\u4e0b\u5c3d\u91cf\u591a\u7684\u540c\u80de\u4eec\uff0c\u4e8e\u662f\u4ed6\u6765\u627e\u4f60\u4e86\u3002<br \/> \u5177\u4f53\u800c\u8a00\uff0c\u4eba\u7684\u9ad8\u5ea6\u53ef\u4ee5\u770b\u6210\u4e00\u5217\u6574\u6570h1,h2,\u2026,hn\u3002<br \/> \u8bbe\u5f53\u4e00\u90e8\u5206\u4eba\u51fa\u53bb\u540e\uff0c\u5269\u4e0b\u7684\u4eba\u7684\u9ad8\u5ea6\u4f9d\u6b21\u4e3ag1,g2,\u2026,gm \uff0c\u5219\u82b1\u4eec\u5e0c\u671b\u4e0b\u9762\u4e24\u4e2a\u6761\u4ef6\u4e2d\u81f3\u5c11\u6709\u4e00\u4e2a\u6ee1\u8db3\uff1a<br \/> \u00b7\u6761\u4ef6A \uff1a\u5bf9\u4e8e\u6240\u6709 g2i>g2i-1,g2i>g2i+1\u3002<br \/> \u00b7\u6761\u4ef6B \uff1a\u5bf9\u4e8e\u6240\u6709 g2i<g2i-1,g2i<g2i+1\u3002\u3002<br \/> \u6ce8\u610f\u4e0a\u9762\u4e24\u4e2a\u6761\u4ef6\u5728 n=1 \u65f6\u540c\u65f6\u6ee1\u8db3\uff0c\u5f53 n > 1 \u65f6\u6700\u591a\u6709\u4e00\u4e2a\u80fd\u6ee1\u8db3\u3002<\/p>\n<h5><a id=\"_8\"><\/a>\u8f93\u5165<\/h5>\n<p>\u7b2c\u4e00\u884c\u5305\u542b\u4e00\u4e2a\u6b63\u6574\u6570 n \uff0c\u8868\u793a\u5f00\u59cb\u65f6\u7684\u4eba\u6570\u3002<br \/> \u7b2c\u4e8c\u884c\u5305\u542b n \u4e2a\u6b63\u6574\u6570\uff0c\u4f9d\u6b21\u4e3a h1,h2,\u2026hn , \u8868\u793a\u6bcf\u4e2a\u4eba\u7684\u9ad8\u5ea6\u3002<\/p>\n<h5><a id=\"_11\"><\/a>\u8f93\u51fa<\/h5>\n<p>\u8f93\u51fa\u7559\u4e0b\u7684\u4eba\u6570\u7684\u6700\u5927\u503c\u3002<\/p>\n<h5><a id=\"_13\"><\/a>\u6837\u4f8b\u8f93\u5165<\/h5>\n<pre><code>5\n5 3 2 1 2\n<\/code><\/pre>\n<h5><a id=\"_18\"><\/a>\u6837\u4f8b\u8f93\u51fa<\/h5>\n<pre><code>3\n<\/code><\/pre>\n<h5><a id=\"_22\"><\/a>\u63d0\u793a<\/h5>\n<p>\u5bf9\u4e8e\u6240\u6709\u6570\u636e\uff0c1\u2264n\u2264106,0\u2264hi\u2264106<\/p>\n<p>\u52a8\u6001\u89c4\u5212<\/p>\n<pre><code>#pragma GCC optimize(1)\n#pragma GCC optimize(2)\n#pragma GCC optimize(3,\"Ofast\",\"inline\")\n#include <bits\/stdc++.h>\nusing namespace std;\ntypedef long long ll;\nll a[1005000]={0};\nll s1[1005000]={0};\nll s2[1005000]={0};\nint main()\n{\n    ll n;\n    scanf(\"%lld\",&n);\n    for(ll i=1;i<=n;i++)\n        scanf(\"%lld\",&#038;a[i]);\n    s1[1]=s2[1]=1;\n    for(ll i=2;i<=n;i++)\n    {\n        if(a[i]>a[i-1])\n        {\n            s1[i]=max(s1[i-1],s2[i-1]+1);\n            s2[i]=s2[i-1];\n        }\n        if(a[i]==a[i-1])\n        {\n            s1[i]=s1[i-1];\n            s2[i]=s2[i-1];\n        }\n        if(a[i]<a[i-1])\n        {\n            s2[i]=max(s2[i],s1[i-1]+1);\n            s1[i]=s1[i-1];\n        }\n    }\n    printf(\"%lldn\",max(s1[n],s2[n]));\n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>http:\/\/icpc.upc.edu.cn\/pr&hellip;<\/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-30","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/wordpress.tim-wcx.ltd\/index.php\/wp-json\/wp\/v2\/posts\/30","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.tim-wcx.ltd\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.tim-wcx.ltd\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.tim-wcx.ltd\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.tim-wcx.ltd\/index.php\/wp-json\/wp\/v2\/comments?post=30"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.tim-wcx.ltd\/index.php\/wp-json\/wp\/v2\/posts\/30\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.tim-wcx.ltd\/index.php\/wp-json\/wp\/v2\/media?parent=30"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.tim-wcx.ltd\/index.php\/wp-json\/wp\/v2\/categories?post=30"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.tim-wcx.ltd\/index.php\/wp-json\/wp\/v2\/tags?post=30"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}