- Team Queue
九九孩子
- 2022-1-14 14:48:56 @
错误是:Runtime Error Aborted
#include <iostream>
#include <list>
#include <algorithm>
using namespace std;
int w[1007][1007];
list<int>l;
int main() {
int n, x = 1;
string s;
while (cin >> n && n) {
cout << "Scenario #" << x << endl;
x++;
for (int i = 1; i <= n; i++) {
int num;
cin >> num;
w[i][0] = 1;
for (int j = 1; j <= num; j++) {
scanf("%d", &w[i][j]);
}
}
int m;
while (cin >> s) {
if (s[0] == 'E') {
cin >> m;
list<int>::iterator iter;
for (int i = 1; i <= n; i++) {
if (w[i][w[i][0]] == m) {
iter = find(l.begin(), l.end(), w[i][w[i][0] - 1]);
w[i][0]++;
if (iter != l.end()) {
iter++;
l.insert(iter, m);
}
else l.push_back(m);
break;
}
}
}
else if (s[0] == 'D') {
cout << l.front() << endl;
l.pop_front();
}
else break;
}
}
return 0;
}
0 comments
No comments so far...
Information
- ID
- 299
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 9
- Tags
- # Submissions
- 11
- Accepted
- 6
- Uploaded By