"「SFCOI-1」Sadness Fan Club Round 1" reward code
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
/** | |
* @file reward.cpp | |
* @author Macesuted (i@macesuted.moe) | |
* @date 2023-03-11 | |
* | |
* @copyright Copyright (c) 2023 | |
* | |
*/ | |
#include <bits/stdc++.h> | |
using namespace std; | |
int main() { | |
mt19937 rnd(123456); | |
int n; | |
cin >> n; // 符合要求的总人数 | |
set<int> S; | |
for (int i = 0; i < 3; i++) { | |
int p = rnd() % n; | |
while (S.count(p)) p = (p + 1) % n; | |
S.insert(p); | |
cout << p + 1 << ' '; | |
} | |
cout << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment