Search found 3 matches

Mon Dec 21, 2009 10:25 am
Forum: Volume 105 (10500-10599)
Topic: 10533 - Digit Primes
Replies: 108
Views: 32964

Re: 10533 - Digit Primes

#include<iostream> #include<math.h> using namespace std; int main() { bool prime[1000000]; long i,j; for(i=2;i<=1000000;i++) prime[i]=true; prime[0]=false; prime[1]=false; for(i=2;i<=1000000;i++) { for(j=i*2;j<=1000000;j=j+i) { if(prime[j]) prime[j]=false; } } long cas; cin>>cas; while(cas--) { lon...
Sun Dec 20, 2009 7:35 am
Forum: Volume 114 (11400-11499)
Topic: 11462 - Age Sort
Replies: 49
Views: 19109

Re: 11462 - Ages Sort

What is real output format for this problem???????????????????????any body can help me?
Wed Nov 18, 2009 12:58 pm
Forum: Volume 102 (10200-10299)
Topic: 10200 - Prime Time
Replies: 202
Views: 63658

Re: 10200 Prime Time

#include<iostream> #include<math.h> using namespace std; int main() { bool prime[10005]; int p=0; prime[0]=false; prime[1]=false; for(p=2;p<=10000;p++) prime[p]=true; int i; for(p=2;p<10001;p++) { for(i=p*2;i<=10000;i=i+p) { if(prime[i]) { prime[i]=false; } } } bool rp[10005]; for(i=0;i<=10000;i++)...