Skip to content

Instantly share code, notes, and snippets.

@wiwiho
wiwiho / ramen.cpp
Last active November 13, 2021 09:14
set<int> f(int n, int k, vector<ll> seed){
set<int> s;
for(int i = 0; s.size() < k; i++){
ll tmp = 47 * seed[0] + 75 * seed[1] + 33 * seed[2] + 87 * seed[3] + 123 * seed[4];
tmp ^= (i * 48763) * (i << 1);
tmp %= n;
for(int j = 3; j >= 0; j--) seed[j] = seed[j + 1];
seed[4] = tmp;
s.insert(tmp % n);
}