{"id":714,"date":"2019-10-01T21:02:23","date_gmt":"2019-10-01T13:02:23","guid":{"rendered":"http:\/\/fankasy.xyz\/?p=714"},"modified":"2019-10-08T17:00:15","modified_gmt":"2019-10-08T09:00:15","slug":"noj1030-%e9%a9%ac%e6%8b%89%e6%9d%be%e7%ab%9e%e8%b5%9b","status":"publish","type":"post","link":"http:\/\/fankasy.xyz\/index.php\/2019\/10\/01\/noj1030-%e9%a9%ac%e6%8b%89%e6%9d%be%e7%ab%9e%e8%b5%9b\/","title":{"rendered":"NOJ1030 \u9a6c\u62c9\u677e\u7ade\u8d5b"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>#include&lt;iostream>\n#include&lt;algorithm>\nusing namespace std;\nint main()\n{\n    int n, m;\n    cin >> n;\n    int origin[1001], lower[1001], upper[1001];\n    int i, j = 0, k = 0;\n    for (i = 0; i &lt; n; i++)\n        cin >> origin[i];\n    cin >> m;\n\n    for (i = 0; i &lt; n; i++)\n    {\n        if (origin[i] &lt; m)\n        {\n            lower[j] = origin[i];\n            j++;\n        }\n        else\n        {\n            upper[k] = origin[i];\n            k++;\n        }\n    }\n\n    if (k == 0)\n    {\n        for (i = 0; i &lt; j - 1; i++)\n            cout &lt;&lt; lower[i] &lt;&lt; \" \";\n        cout &lt;&lt; lower[j - 1] &lt;&lt; endl &lt;&lt; endl;\n    }\n    else\n    {\n        for (i = 0; i &lt; j; i++)\n            cout &lt;&lt; lower[i] &lt;&lt; \" \";\n        for (i = 0; i &lt; k - 1; i++)\n            cout &lt;&lt; upper[i] &lt;&lt; \" \";\n        cout &lt;&lt; upper[k - 1] &lt;&lt; endl;\n        sort(upper, upper + k);\n        for (i = 0; i &lt; k - 1; i++)\n            cout &lt;&lt; upper[i] &lt;&lt; \" \";\n        cout &lt;&lt; upper[k - 1] &lt;&lt; endl;\n    }\n    return 0;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","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\/714"}],"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=714"}],"version-history":[{"count":0,"href":"http:\/\/fankasy.xyz\/index.php\/wp-json\/wp\/v2\/posts\/714\/revisions"}],"wp:attachment":[{"href":"http:\/\/fankasy.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/fankasy.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=714"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/fankasy.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}