結果
問題 | No.714 回転寿司屋のシミュレート |
ユーザー |
|
提出日時 | 2018-07-13 22:46:02 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 20 ms / 2,000 ms |
コード長 | 641 bytes |
コンパイル時間 | 1,776 ms |
コンパイル使用メモリ | 176,832 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-09 05:25:40 |
合計ジャッジ時間 | 2,917 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; map<string, int> sushi[22]; for (int ni = 0; ni < n; ni++) { int c; cin >> c; if (c == 0) { int num, k; cin >> num >> k; for (int i = 0; i < k; i++) { string s; cin >> s; sushi[num][s]++; } } if (c == 1) { string s; cin >> s; for (int i = 1; i <= 20; i++) { if (sushi[i][s] != 0) { sushi[i][s]--; cout << i << endl; break; } if (i == 20) cout << -1 << endl; } } if (c == 2) { int c; cin >> c; sushi[c].clear(); } } return 0; }