Cod sursa(job #1788090)

Utilizator bciobanuBogdan Ciobanu bciobanu Data 25 octombrie 2016 17:35:07
Problema Hashuri Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.63 kb
// 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;
}