Skip to content

Instantly share code, notes, and snippets.

@Macesuted
Last active March 11, 2023 06:16
Show Gist options
  • Save Macesuted/53d37d799d92d44bae3e84224a98aaa9 to your computer and use it in GitHub Desktop.
Save Macesuted/53d37d799d92d44bae3e84224a98aaa9 to your computer and use it in GitHub Desktop.
"「SFCOI-1」Sadness Fan Club Round 1" reward code
/**
* @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