結果
問題 | No.714 回転寿司屋のシミュレート |
ユーザー |
![]() |
提出日時 | 2019-07-17 21:05:00 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 1,109 bytes |
コンパイル時間 | 1,714 ms |
コンパイル使用メモリ | 174,164 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-23 07:58:33 |
合計ジャッジ時間 | 2,907 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
#include<bits/stdc++.h>using namespace std;typedef long long ll;signed main(){ios::sync_with_stdio(false);cin.tie(0);int n;cin>>n;vector<vector<string>> seki(20);for(int i=0;i<n;i++){int d;cin>>d;if(d==0){int k,m;cin>>k>>m;k--;for(int j=0;j<m;j++){string s;cin>>s;seki[k].push_back(s);}}if(d==1){string s;cin>>s;bool erase=false;for(int j=0;j<20;j++){for(int k=0;k<seki[j].size();k++){if(seki[j][k]==s){erase=true;cout<<j+1<<"\n";seki[j][k]="";break;}}if(erase) break;}if(!erase) cout<<-1<<"\n";}if(d==2){int s;cin>>s;vector<string> v;seki[s-1] = v;}}}