OverClocking!

This commit is contained in:
e2hang
2025-08-15 22:16:42 +08:00
parent f40ad1c843
commit 8edd0f98b5
7 changed files with 50 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> a;
for (int i = 0; i < n; i++) {
a.push_back(i + 1);
}
int idx = 0;
while (!a.empty()) {
idx = (idx + m - 1) % a.size();
cout << a[idx] << " ";
a.erase(a.begin() + idx);
}
cout << endl;
return 0;
}