結果
問題 | No.714 回転寿司屋のシミュレート |
ユーザー |
|
提出日時 | 2018-08-11 20:34:51 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 7 ms / 2,000 ms |
コード長 | 982 bytes |
コンパイル時間 | 1,689 ms |
コンパイル使用メモリ | 178,548 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-23 06:26:20 |
合計ジャッジ時間 | 2,938 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
#include <bits/stdc++.h>using namespace std;using dict = unordered_map<string, int>;int main() {cin.tie(0);ios::sync_with_stdio(false);vector<dict> order(21, dict());int N;cin >> N;while (N--){int type;cin >> type;if (type == 0){int n, m;cin >> n >> m;while (m--){string neta;cin >> neta;++order[n][neta];}}else if (type == 1){string neta;cin >> neta;int who = -1;for (int seat = 1; seat <= 20; ++seat){if (order[seat][neta] > 0){--order[seat][neta];who = seat;break;}}cout << who << '\n';}else if (type == 2){int seat;cin >> seat;order[seat].clear();}}return 0;}