結果
問題 | No.714 回転寿司屋のシミュレート |
ユーザー |
|
提出日時 | 2022-06-09 05:28:37 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 10 ms / 2,000 ms |
コード長 | 869 bytes |
コンパイル時間 | 1,679 ms |
コンパイル使用メモリ | 174,968 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-21 05:22:31 |
合計ジャッジ時間 | 3,313 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
#include<bits/stdc++.h>using namespace std;using ll = long long;int main(){int Q;cin >> Q;vector<multiset<string>> seat(21);while(Q--){int cmd;cin >> cmd;if(cmd == 1){string s;cin >> s;int ans = -1;for(int i = 1; i <= 20; i++){auto it = seat[i].find(s);if(it == seat[i].end())continue;seat[i].erase(it);ans = i;break;}cout << ans << '\n';}else if(cmd == 0){int n, m;string s;cin >> n >> m;for(int i = 0; i < m; i++){cin >> s;seat[n].insert(s);}}else{int C;cin >> C;seat[C].clear();}}}