結果
| 問題 |
No.714 回転寿司屋のシミュレート
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-07-13 22:50:58 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 12 ms / 2,000 ms |
| コード長 | 780 bytes |
| コンパイル時間 | 784 ms |
| コンパイル使用メモリ | 81,388 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-09 05:27:03 |
| 合計ジャッジ時間 | 1,867 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 35 |
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <string>
using namespace std;
int scan() {
int n;
cin >> n;
return n;
}
string input() {
string s;
cin >> s;
return s;
}
int main() {
int n;
cin >> n;
vector<multiset<string>> st(20);
for (int i = 0; i < n; i++) {
int type;
cin >> type;
if (type == 0) {
int j = scan() - 1;
int m = scan();
while (m--) st[j].insert(input());
} else if (type == 1) {
int ans = -1;
string b = input();
for (int j = 0; j < 20; j++) {
if (st[j].count(b)) {
ans = j + 1;
st[j].erase(st[j].find(b));
break;
}
}
cout << ans << endl;
} else {
st[scan() - 1].clear();
}
}
}