Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<algorithm>
- #include<vector>
- #include<random>
- #include<functional>
- using namespace std;
- main() {
- string str = "FDforces Round #1 (Div. 1)";
- auto seed = hash<string>()(str);
- mt19937 mt(seed);
- vector<int> participant{4, 5, 7, 8, 9, 10};
- random_shuffle(participant.begin(), participant.end(), [&mt](int x) {
- uniform_int_distribution<> dis(0, x - 1);
- return dis(mt);
- });
- auto pick = bind(uniform_int_distribution<>(0, participant.size() - 1), mt);
- cout << participant[pick()] << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement