Last active
November 13, 2021 09:14
-
-
Save wiwiho/c41eca6f5976b4c620b41225ab466753 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
return s; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment