Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool primes[9999+1];
- int main(){
- for (int i=2; i*i <=9999; i++){
- if (primes[i] == true)
- continue;
- for (int j = 2 * i ; j <= 9999; j += i)
- primes[j] = true;
- }
- int N; // its number of vertexes
- for (int i=1000; i<=9999;i++){
- if (primes[i] == false)
- N++;
- }
- int start, end;
- int times;
- cin >> times;
- for (int i=0;i<times; i++){
- cin >> start >> end;
- // algo
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement