{"id":261,"date":"2023-09-12T11:29:33","date_gmt":"2023-09-12T03:29:33","guid":{"rendered":"https:\/\/solost.cn\/?p=261"},"modified":"2023-09-12T11:29:33","modified_gmt":"2023-09-12T03:29:33","slug":"390","status":"publish","type":"post","link":"https:\/\/solost.cn\/?p=261","title":{"rendered":"AcWing 869. \u8bd5\u9664\u6cd5\u6c42\u7ea6\u6570"},"content":{"rendered":"<h2>\u9898\u76ee\u94fe\u63a5<\/h2>\n<p><a href=\"https:\/\/www.acwing.com\/problem\/content\/871\/\">\u9898\u76ee\u94fe\u63a5<\/a><\/p>\n<h2>\u4ee3\u7801<\/h2>\n<pre><code class=\"c++\">#include &lt;iostream&gt;\n#include &lt;algorithm&gt;\n#include &lt;vector&gt;\n\nusing namespace std;\n\nvector&lt;int&gt; get_divisors(int x)\n{\n    vector&lt;int&gt; res;\n    for (int i = 1; i &lt;= x \/ i; i ++ )\n        if (x % i == 0)\n        {\n            res.push_back(i);\n            if (i != x \/ i) res.push_back(x \/ i);\n        }\n    sort(res.begin(), res.end());\n    return res;\n}\n\nint main()\n{\n    int n;\n    cin &gt;&gt; n;\n\n    while (n -- )\n    {\n        int x;\n        cin &gt;&gt; x;\n        auto res = get_divisors(x);\n\n        for (auto x : res) cout &lt;&lt; x &lt;&lt; &#039; &#039;;\n        cout &lt;&lt; endl;\n    }\n\n    return 0;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u9898\u76ee\u94fe\u63a5 \u9898\u76ee\u94fe\u63a5 \u4ee3\u7801 #include &lt;iostream&gt; #include &lt;algorithm&gt; #include &lt;vector&gt; using namespace std; vector&lt;int&gt; get_divisors(int x) { vector&lt;int&gt; res; for (int i = 1; i &lt;= x \/ i; i ++ ) if (x % i == 0) { res.push_back(i); if (i != x \/ i) res.push_back(x \/ i); } sort(res.begin(), res.end()); return res; } int [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[72],"tags":[11],"class_list":["post-261","post","type-post","status-publish","format-standard","hentry","category-acm","tag-11"],"_links":{"self":[{"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/posts\/261","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/solost.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=261"}],"version-history":[{"count":0,"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/posts\/261\/revisions"}],"wp:attachment":[{"href":"https:\/\/solost.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=261"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/solost.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=261"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/solost.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}