Pagini recente » Cod sursa (job #952698) | Cod sursa (job #1831479) | Cod sursa (job #828942) | Cod sursa (job #1275630) | Cod sursa (job #1788090)
// anti unordered_* generator
#include <bits/stdc++.h>
using namespace std;
int main() {
ifstream cin("hashuri.in");
ofstream cout("hashuri.out");
cin.tie(0);
ios_base::sync_with_stdio(false);
const vector<int> MOD = {2, 5, 11, 23, 47, 97, 199, 409, 823, 1741, 3739, 7517, 15173, 30727, 62233, 126271, 256279, 520241, 1056323, 2144977, 4355707, 8844859, 17961079};
int n; cin >> n;
int mod = *upper_bound(MOD.begin(), MOD.end(), n - 1);
unordered_set<int> hash_set;
hash_set.max_load_factor(.5);
for (int iter = 0; iter < n; iter += 1) {
hash_set.insert(mod * iter);
}
return 0;
}