Last active
March 11, 2023 06:16
-
-
Save Macesuted/53d37d799d92d44bae3e84224a98aaa9 to your computer and use it in GitHub Desktop.
"「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