C++ 代码
#include<iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int n;
int q[15];
int main() {
cin >> n;
string op;
while(cin >> op) {
if(op == "add") {
int x;
cin >> x;
q[0] ++;
}
else if (op == "sync") {
int x;
cin >> x;
if (q[x] == q[0]) continue;
q[x] ++;
}
else {
int res = q[0];
for(int i = 1; i < n; i ++) {
res = min(res, q[i]);
}
cout << res << endl;
}
}
return 0;
}