結果
問題 | No.714 回転寿司屋のシミュレート |
ユーザー | mamekin |
提出日時 | 2018-07-13 22:28:21 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 11 ms / 2,000 ms |
コード長 | 1,375 bytes |
コンパイル時間 | 1,029 ms |
コンパイル使用メモリ | 108,364 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-09 05:23:28 |
合計ジャッジ時間 | 2,169 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
#define _USE_MATH_DEFINES #include <cstdio> #include <iostream> #include <sstream> #include <fstream> #include <iomanip> #include <algorithm> #include <cmath> #include <complex> #include <string> #include <vector> #include <array> #include <list> #include <queue> #include <stack> #include <set> #include <map> #include <bitset> #include <numeric> #include <limits> #include <climits> #include <cfloat> #include <functional> #include <iterator> using namespace std; int main() { int q; cin >> q; vector<multiset<string> > v(21); while(--q >= 0){ int type; cin >> type; if(type == 0){ int i, n; cin >> i >> n; while(--n >= 0){ string s; cin >> s; v[i].insert(s); } } else if(type == 1){ string s; cin >> s; bool ok = false; for(int i=1; i<=20; ++i){ auto it = v[i].find(s); if(it != v[i].end()){ v[i].erase(it); cout << i << endl; ok = true; break; } } if(!ok) cout << -1 << endl; } else{ int i; cin >> i; v[i].clear(); } } return 0; }