This commit is contained in:
HuangHai
2025-08-30 18:35:01 +08:00
commit 1f397eca87
6258 changed files with 1487241 additions and 0 deletions

33
TangDou/XiTi/1373.cpp Normal file
View File

@@ -0,0 +1,33 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
int o, p, q, n;
cin >> o >> p >> q >> n;
queue<int> oq, pq, qq;
//填充三个队列
for (int i = 0; i < o; ++i) {
oq.push(i + 1);
}
for (int i = 0; i < p; ++i) {
pq.push(i + 1);
}
for (int i = 0; i < q; ++i) {
qq.push(i + 1);
}
//开始模拟轮次
for (int i = 0; i < n; ++i) {
int a = oq.front();
int b = pq.front();
int c = qq.front();
cout << a << " " << b << " " << c << endl;
oq.pop();
pq.pop();
qq.pop();
oq.push(a);
pq.push(b);
qq.push(c);
}
return 0;
}