Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:我怎用了这个公式还超时啊!!!In Reply To:我怎用了这个公式还超时啊!!! Posted by:changzhiwin at 2008-07-10 14:34:29 我用的打表,也是超时了,郁闷!!! > for(i=2;i<2237;i++) > for(j=i;j*i<=5000000;j++) > if(!prim[i*j]) > prim[i*j]=1; > j=0; > for(i=2;i<5000001;i++) > { > if(prim[i]==0) > prim[j++]=i; > } > 难道上面的打表有什么不对吗? Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator