結果
問題 |
No.714 回転寿司屋のシミュレート
|
ユーザー |
|
提出日時 | 2020-07-02 03:01:54 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 615 bytes |
コンパイル時間 | 1,982 ms |
コンパイル使用メモリ | 203,688 KB |
最終ジャッジ日時 | 2025-01-11 13:55:49 |
ジャッジサーバーID (参考情報) |
judge5 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main(){ cin.tie(0),ios::sync_with_stdio(false); int N; cin>>N; vector<unordered_map<string,int>>v(20); for(int i=0;i<N;++i){ int d; cin>>d; if(d==0){ int n,m; cin>>n>>m; --n; for(int j=0;j<m;++j){ string a; cin>>a; ++v.at(n)[a]; } } else if(d==1){ string b; cin>>b; int who=-1; for(int j=0;j<20;++j){ if(v.at(j).find(b)!=v.at(j).end()){ --v.at(j).at(b); if(v.at(j).at(b)==0)v.at(j).erase(b); who=j+1; break; } } cout<<who<<"\n"s; } else{ int c; cin>>c; --c; v.at(c).clear(); } } }