Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <bitset>
- #include <random>
- #include <ctime>
- using namespace std;
- int main() {
- vector<bitset<1000000>> a (10);
- ofstream file("nums.txt");
- srand(time(0));
- for (int i = 0; i < 9000000; ++i) {
- if (i % 1000 == 0) {
- cout << "Still computing" << '\n';
- }
- while (true) {
- int j = ((int)rand()) % 9000000 + 1000000;
- if (!a[j / 1000000][j % 1000000]) {
- file << j << '\n';
- a[j / 1000000][j % 1000000] = 1;
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement