結果
問題 | No.714 回転寿司屋のシミュレート |
ユーザー |
|
提出日時 | 2018-07-13 23:00:01 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 12 ms / 2,000 ms |
コード長 | 656 bytes |
コンパイル時間 | 1,812 ms |
コンパイル使用メモリ | 174,736 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-09 05:28:28 |
合計ジャッジ時間 | 2,901 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define ll long long#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)int main() {vector<multiset<string>> ss(21);int N; cin>>N;rep(_i, N) {int p; cin>>p;if(p==0) {int n,m; cin>>n>>m;rep(i,m) {string s; cin>>s;ss[n].insert(s);}} else if(p==1) {string b;cin>>b;bool f=true;rep(i,21) {if(ss[i].find(b)!=ss[i].end()) {auto itr = ss[i].find(b);ss[i].erase(itr);cout<<i<<endl;f=false;break;}}if(f) cout<<"-1"<<endl;} else { // p==2int c;cin>>c;ss[c].clear();}}return 0;}