{"id":286,"date":"2010-06-18T18:58:00","date_gmt":"2010-06-18T10:58:00","guid":{"rendered":"http:\/\/localhost\/?p=286"},"modified":"2010-06-18T18:58:00","modified_gmt":"2010-06-18T10:58:00","slug":"beijing2010_take_a_few_games_game","status":"publish","type":"post","link":"https:\/\/www.shuizilong.com\/wjmzbmr\/?p=286","title":{"rendered":"[BeiJing2010]\u53d6\u6570\u6e38\u620f game"},"content":{"rendered":"\n<p>[BeiJing2010]\u53d6\u6570\u6e38\u620f game<\/p>\n<p>Time Limit:10000MS  Memory Limit:65536K<br \/>Total Submit:16 Accepted:9 <br \/>Case Time Limit:1000MS<\/p>\n<p><strong>Description <\/strong><\/p>\n<p>\u5c0f C \u521a\u5b66\u4e86\u8f97\u8f6c\u76f8\u9664\u6cd5\uff0c\u6b63\u4e0d\u4ea6\u4e50\u4e4e\uff0c\u8fd9\u5c0f P \u53c8\u51fa\u6765\u6363\u4e71\uff0c\u7ed9\u5c0f C \u7559\u4e86\u4e2a <br \/>\u96be\u9898\u3002 <br \/>\u7ed9 N \u4e2a\u6570\uff0c\u7528 a1,a2\u2026an\u6765\u8868\u793a\u3002\u73b0\u5728\u5c0f P \u8ba9\u5c0f C \u4f9d\u6b21\u53d6\u6570\uff0c\u7b2c\u4e00\u4e2a\u6570\u53ef\u4ee5 <br \/>\u968f\u610f\u53d6\u3002\u5047\u4f7f\u76ee\u524d\u53d6\u5f97 aj\uff0c\u4e0b\u4e00\u4e2a\u6570\u53d6ak(k&gt;j)\uff0c\u5219ak\u5fc5\u987b\u6ee1\u8db3gcd(aj,ak)\u2265L\u3002 <br \/>\u5230\u5e95\u8981\u53d6\u591a\u5c11\u4e2a\u6570\u5462\uff1f\u81ea\u7136\u662f\u8d8a\u591a\u8d8a\u597d\uff01 <br \/>\u4e0d\u7528\u591a\u8bf4\uff0c\u8fd9\u4e0d\u4ec5\u662f\u7ed9\u5c0f C \u7684\u96be\u9898\uff0c\u4e5f\u662f\u7ed9\u4f60\u7684\u96be\u9898\u3002 <\/p>\n<p><strong>Input <\/strong><\/p>\n<p>\u7b2c\u4e00\u884c\u5305\u542b\u4e24\u4e2a\u6570N \u548c L\u3002 <br \/>\u63a5\u4e0b\u6765\u4e00\u884c\uff0c\u6709 N \u4e2a\u6570\u7528\u7a7a\u683c\u9694\u5f00\uff0c\u4f9d\u6b21\u662f a1,a2\u2026an\u3002 <\/p>\n<p><strong>Output <\/strong><\/p>\n<p>\u4ec5\u5305\u542b\u4e00\u884c\u4e00\u4e2a\u6570\uff0c\u8868\u793a\u6309\u4e0a\u8ff0\u53d6\u6cd5\uff0c\u6700\u591a\u53ef\u4ee5\u53d6\u7684\u6570\u7684\u4e2a\u6570\u3002 <\/p>\n<p><strong>Sample Input <\/strong><\/p>\n<\/p>\n<p><strong>Sample Output <\/strong><\/p>\n<\/p>\n<p><strong>Hint <\/strong><\/p>\n<p>\u9009\u53d6 3\u4e2a\u657016\u300124\u30016\u3002gcd(16,24)=8\uff0cgcd(24,6)=6\u3002 <\/p>\n<p>2\u2264L\u2264ai\u22641 000 000\uff1b <br \/>30% \u7684\u6570\u636eN\u22641000\uff1b <br \/>100% \u7684\u6570\u636e N\u226450 000<\/p>\n<p><strong>Source <br \/>\u989d\u3002\u3002\u8fd9\u9898\u611f\u89c9\u8ddfVIJOS\u4e0a\u4e00\u9898\u4e00\u6837\u3002\u3002\u8bb0Dpi\u8868\u793a\u4ee5i\u7684\u500d\u6570\u4e3a\u7ed3\u5c3e\u7684\u6700\u957f\u957f\u5ea6\u3002\u3002\u7136\u540eDp\u4e00\u4e0b\u5c31\u53ef\u4ee5\u4e86\u3002\u3002<br \/><\/strong><\/p>\n<p>#include &lt;algorithm&gt;#include &lt;cstdio&gt;#define rep(i,n) for(int i=0;i&lt;n;i++)const int inf=~0U&gt;&gt;1,maxw=1000000,maxp=10000;using namespace std;int Dp[maxw+1]={},n,L,List[maxp];int main(){    scanf(&quot;%d%d&quot;,&amp;n,&amp;L);    rep(i,n)    {        int x,tmp=0,c=0;        scanf(&quot;%d&quot;,&amp;x);        for(int i=1;i*i&lt;=x;i++)            if(x%i==0)            {                if(i&gt;=L)List[c++]=i;                if(x\/i&gt;=L)List[c++]=x\/i;            }        rep(i,c)tmp=max(tmp,Dp[List[i]]);tmp++;        rep(i,c)Dp[List[i]]=tmp;    }    int ans=0;    rep(i,maxw+1)ans=max(ans,Dp[i]);    printf(&quot;%dn&quot;,ans);}35 6 7 16 9 24 6 <\/p>\n","protected":false},"excerpt":{"rendered":"<p>[BeiJing2010]\u53d6\u6570\u6e38\u620f game Time Limit:10000MS Memory Limit:65536KTotal Submit:16 Accepted:9 Case Time Limit:1000MS Description \u5c0f C \u521a\u5b66\u4e86\u8f97\u8f6c\u76f8\u9664\u6cd5\uff0c\u6b63\u4e0d\u4ea6\u4e50\u4e4e\uff0c\u8fd9\u5c0f P \u53c8\u51fa\u6765\u6363\u4e71\uff0c\u7ed9\u5c0f C \u7559\u4e86\u4e2a \u96be\u9898\u3002 \u7ed9 N \u4e2a\u6570\uff0c\u7528 a1,a2\u2026an\u6765\u8868\u793a\u3002\u73b0\u5728\u5c0f P \u8ba9\u5c0f C \u4f9d\u6b21\u53d6\u6570\uff0c\u7b2c\u4e00\u4e2a\u6570\u53ef\u4ee5 \u968f\u610f\u53d6\u3002\u5047\u4f7f\u76ee\u524d\u53d6\u5f97 aj\uff0c\u4e0b\u4e00\u4e2a\u6570\u53d6ak(k&gt;j)\uff0c\u5219ak\u5fc5\u987b\u6ee1\u8db3gcd(aj,ak)\u2265L\u3002 \u5230\u5e95\u8981\u53d6\u591a\u5c11\u4e2a\u6570\u5462\uff1f\u81ea\u7136\u662f\u8d8a\u591a\u8d8a\u597d\uff01 \u4e0d\u7528\u591a\u8bf4\uff0c\u8fd9\u4e0d\u4ec5\u662f\u7ed9\u5c0f C \u7684\u96be\u9898\uff0c\u4e5f\u662f\u7ed9\u4f60\u7684\u96be\u9898\u3002 Input \u7b2c\u4e00\u884c\u5305\u542b\u4e24\u4e2a\u6570N \u548c L\u3002 \u63a5\u4e0b\u6765\u4e00\u884c\uff0c\u6709 N \u4e2a\u6570\u7528\u7a7a\u683c\u9694\u5f00\uff0c\u4f9d\u6b21\u662f a1,a2\u2026an\u3002 Output \u4ec5\u5305\u542b\u4e00\u884c\u4e00\u4e2a\u6570\uff0c\u8868\u793a\u6309\u4e0a\u8ff0\u53d6\u6cd5\uff0c\u6700\u591a\u53ef\u4ee5\u53d6\u7684\u6570\u7684\u4e2a\u6570\u3002 Sample Input Sample Output Hint \u9009\u53d6 3\u4e2a\u657016\u300124\u30016\u3002gcd(16,24)=8\uff0cgcd(24,6)=6\u3002 2\u2264L\u2264ai\u22641 000 000\uff1b 30% [&hellip;]<\/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\/286"}],"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=286"}],"version-history":[{"count":0,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/posts\/286\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}