Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:我怎用了这个公式还超时啊!!!

Posted by wujiabao at 2008-07-11 10:29:43 on Problem 3604
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator