Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <string>
- const int N = 1000000;
- using namespace std;
- int main() {
- vector<char> a(N, true);
- a[0] = a[1] = false;
- for(long long i = 2; i < N; i++)
- if(a[i])
- if(i * i < N)
- for(long long j = i * i; j < N; j+= i)
- a[j] = false;
- string s = "01";
- for(long long i = 2; i < N; i++)
- if(!a[i])
- s+= to_string(i);
- for(int i = 2012; i < 2022; i++)
- cout << s.at(i);
- cout << endl;
- //38 44 84 58 46
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement