Advertisement
Guest User

prime-path-s

a guest
Jul 11th, 2010
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. bool primes[9999+1];
  5.  
  6.  
  7. int main(){
  8.     for (int i=2; i*i <=9999; i++){
  9.         if (primes[i] == true)
  10.             continue;
  11.         for (int j = 2 * i ; j <= 9999; j += i)
  12.             primes[j] = true;
  13.     }
  14.    
  15.     int N; // its number of vertexes
  16.     for (int i=1000; i<=9999;i++){
  17.         if (primes[i] == false)
  18.             N++;
  19.     }
  20.    
  21.     int start, end;
  22.     int times;
  23.     cin >> times;
  24.     for (int i=0;i<times; i++){
  25.         cin >> start >> end;
  26.         // algo
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement