{"id":76,"date":"2010-02-03T15:31:00","date_gmt":"2010-02-03T07:31:00","guid":{"rendered":"http:\/\/localhost\/?p=76"},"modified":"2010-02-03T15:31:00","modified_gmt":"2010-02-03T07:31:00","slug":"sgu_499","status":"publish","type":"post","link":"https:\/\/www.shuizilong.com\/wjmzbmr\/?p=76","title":{"rendered":"SGU 499"},"content":{"rendered":"<p> \u8fd9\u9053\u9898\u662f\u7ed9N\u4e2a\u6570\u3002\u3002\u90fd\u5c0f\u4e8e10^6\u6b21\u65b9\uff0c\u6c42\u51fa\u5176\u4e2d\u4e24\u4e24\u4e4b\u95f4\u6700\u5927\u7684\u6700\u5927\u516c\u7ea6\u6570\u662f\u591a\u5c11\u3002\u3002<br \/>\u5f88\u663e\u7136\u53ef\u4ee5\u66b4\u529b\u6c42\u3002\u3002\u4e0d\u8fc7\u90a3\u662fN^2\u7684\u3002\u3002\u6ce8\u610f\u5230\u6240\u6709\u6570\u90fd\u572810^6\u6b21\u65b9\u4e00\u4e0b\u3002\u3002\u6240\u4ee5<br \/>\u53ef\u4ee5\u5417\u679a\u4e3e\u7b54\u6848\u6765\u68c0\u6d4b\u3002\u3002\u5c31\u662f\u8bf4\u5f00\u4e00\u4e2a\u6570\u7ec4\uff0c\u5927\u5c0f\u4e3a10^6\u3002\u3002\u6bcf\u4e2a\u4e2d\u8bb0\u5f55\u5176\u4e2d\u5728\u8fd9\u4e2a\u7d22\u5f15\u7684\u6570\u6709\u591a\u5c11\u4e2a\u3002\u3002\u3002\u90a3\u4e48\u53ef\u4ee5\u5f88\u65b9\u4fbf\u7684\u68c0\u6d4b\u51fa\u4e00\u4e2a\u6570\u7684\u500d\u6570\u6709\u591a\u5c11\u4e2a\u3002\u3002\u53ea\u8981&gt;1\u5c31\u66f4\u65b0\u7b54\u6848\u3002\u3002\u3002<br \/>\u8ba1\u7b97\u590d\u6742\u5ea6\u662f10^6*log(10^6)\u7684\u3002\u3002\u3002<br \/>Code\uff1a<br \/>#include&lt;cstdio&gt;<br \/>#include&lt;cstring&gt;<br \/>#include&lt;algorithm&gt;<br \/>using namespace std;<br \/>const int maxn=1000000;<br \/>class solve<br \/>{<br \/> short Num[maxn+1];int M;<br \/> void init()<br \/> {<br \/>  int n,x;scanf(&quot;%d&quot;,&amp;n);memset(Num,0,sizeof(Num));M=0;<br \/>  while(n&#8211;) scanf(&quot;%d&quot;,&amp;x),Num[x]++,M=max(M,x);<br \/> }<br \/> bool check(int x)<br \/> {<br \/>  int cnt=0;<br \/>  for(int i=x;i&lt;=M&amp;&amp;cnt&lt;2;i+=x)<br \/>   cnt+=Num[i];<br \/>  return cnt&gt;1;<br \/> }<br \/> int work()<br \/> {<br \/>  for(int i=M;i;i&#8211;) if(check(i)) return <a href=\"http:\/\/www.opengroup.org\/onlinepubs\/009695399\/functions\/printf.html\">printf<\/a>(&quot;%dn&quot;,i);<br \/> }<br \/> public:<br \/> solve()<br \/> {<br \/>  init();<br \/>  work();<br \/> }<br \/>};<br \/>int main()<br \/>{<br \/> solve now;<br \/>}\u987a\u4fbf\u53d1\u4e00\u4e0bGedit\u7684\u56fe\u7247\u3002\u3002\u4ee3\u7801\u6f02\u4eae\u6b7b\u4e86\u3002\u3002\u4eab\u53d7\u554a\u3002\u3002<br \/><img decoding=\"async\" src=\"http:\/\/wjmzbmr.com\/wp-content\/uploads\/pic\/4c3d6d015ed93dbad53f7cf6.jpg\" small=\"0\" class=\"blogimg\" \/> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u9053\u9898\u662f\u7ed9N\u4e2a\u6570\u3002\u3002\u90fd\u5c0f\u4e8e10^6\u6b21\u65b9\uff0c\u6c42\u51fa\u5176\u4e2d\u4e24\u4e24\u4e4b\u95f4\u6700\u5927\u7684\u6700\u5927\u516c\u7ea6\u6570\u662f\u591a\u5c11\u3002\u3002\u5f88\u663e\u7136\u53ef\u4ee5\u66b4\u529b\u6c42\u3002\u3002\u4e0d\u8fc7\u90a3\u662fN^2\u7684\u3002\u3002\u6ce8\u610f\u5230\u6240\u6709\u6570\u90fd\u572810^6\u6b21\u65b9\u4e00\u4e0b\u3002\u3002\u6240\u4ee5\u53ef\u4ee5\u5417\u679a\u4e3e\u7b54\u6848\u6765\u68c0\u6d4b\u3002\u3002\u5c31\u662f\u8bf4\u5f00\u4e00\u4e2a\u6570\u7ec4\uff0c\u5927\u5c0f\u4e3a10^6\u3002\u3002\u6bcf\u4e2a\u4e2d\u8bb0\u5f55\u5176\u4e2d\u5728\u8fd9\u4e2a\u7d22\u5f15\u7684\u6570\u6709\u591a\u5c11\u4e2a\u3002\u3002\u3002\u90a3\u4e48\u53ef\u4ee5\u5f88\u65b9\u4fbf\u7684\u68c0\u6d4b\u51fa\u4e00\u4e2a\u6570\u7684\u500d\u6570\u6709\u591a\u5c11\u4e2a\u3002\u3002\u53ea\u8981&gt;1\u5c31\u66f4\u65b0\u7b54\u6848\u3002\u3002\u3002\u8ba1\u7b97\u590d\u6742\u5ea6\u662f10^6*log(10^6)\u7684\u3002\u3002\u3002Code\uff1a#include&lt;cstdio&gt;#include&lt;cstring&gt;#include&lt;algorithm&gt;using namespace std;const int maxn=1000000;class solve{ short Num[maxn+1];int M; void init() { int n,x;scanf(&quot;%d&quot;,&amp;n);memset(Num,0,sizeof(Num));M=0; while(n&#8211;) scanf(&quot;%d&quot;,&amp;x),Num[x]++,M=max(M,x); } bool check(int x) { int cnt=0; for(int i=x;i&lt;=M&amp;&amp;cnt&lt;2;i+=x) cnt+=Num[i]; return cnt&gt;1; } int work() { for(int i=M;i;i&#8211;) if(check(i)) return printf(&quot;%dn&quot;,i); } public: solve() { init(); work(); }};int main(){ solve now;}\u987a\u4fbf\u53d1\u4e00\u4e0bGedit\u7684\u56fe\u7247\u3002\u3002\u4ee3\u7801\u6f02\u4eae\u6b7b\u4e86\u3002\u3002\u4eab\u53d7\u554a\u3002\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/posts\/76"}],"collection":[{"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=76"}],"version-history":[{"count":0,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/posts\/76\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=76"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=76"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=76"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}