{"id":9,"date":"2023-01-10T14:10:00","date_gmt":"2023-01-10T06:10:00","guid":{"rendered":"https:\/\/solost.cn\/?p=9"},"modified":"2023-10-05T14:32:54","modified_gmt":"2023-10-05T06:32:54","slug":"9","status":"publish","type":"post","link":"https:\/\/solost.cn\/?p=9","title":{"rendered":"\u7ebf\u6027\u7b5b"},"content":{"rendered":"<p>\u7ebf\u6027\u7b5b\uff0cprimes\u91cc\u9762\u5b58\u77402\uff0c3\uff0c5\u7b49\u7b49\u7684\u7d20\u6570\uff0cst\u6570\u7ec4\u91cc\u9762\u5b58\u7740\u67d0\u4e2a\u6570\u662f\u4e0d\u662f\u8d28\u6570<\/p>\n<pre><code class=\"C++\">const int N = 2e4;\nint primes[N], cnt;\nbool st[N];\nvoid get_primes(int n)\n{\n    for (int i = 2; i &lt;= n; i++) {\n        if (!st[i])\n            primes[cnt++] = i;\n        for (int j = 0; primes[j] &lt;= n \/ i; j++) {\n            st[primes[j] * i] = true;\n            if (i % primes[j] == 0)\n                break;\n        }\n    }\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u7ebf\u6027\u7b5b\uff0cprimes\u91cc\u9762\u5b58\u77402\uff0c3\uff0c5\u7b49\u7b49\u7684\u7d20\u6570\uff0cst\u6570\u7ec4\u91cc\u9762\u5b58\u7740\u67d0\u4e2a\u6570\u662f\u4e0d\u662f\u8d28\u6570 const int N = 2e4; int primes[N], cnt; bool st[N]; void get_primes(int n) { for (int i = 2; i &lt;= n; i++) { if (!st[i]) primes[cnt++] = i; for (int j = 0; primes[j] &lt;= n \/ i; j++) { st[primes[j] * i] = true; if (i % primes[j] == 0) break; } [&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":[],"class_list":["post-9","post","type-post","status-publish","format-standard","hentry","category-acm"],"_links":{"self":[{"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/posts\/9","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=9"}],"version-history":[{"count":0,"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/posts\/9\/revisions"}],"wp:attachment":[{"href":"https:\/\/solost.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/solost.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/solost.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}