結果
問題 | No.714 回転寿司屋のシミュレート |
ユーザー |
|
提出日時 | 2022-10-03 23:27:34 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 9 ms / 2,000 ms |
コード長 | 932 bytes |
コンパイル時間 | 2,100 ms |
コンパイル使用メモリ | 203,644 KB |
最終ジャッジ日時 | 2025-02-07 21:02:08 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
#include <bits/stdc++.h>#define rep(i,n) for(int i = 0; i < (n); i++)using namespace std;typedef long long ll;int main(){cin.tie(0);ios::sync_with_stdio(0);int N; cin >> N;vector<multiset<string>> A(20);rep(_,N) {int t; cin >> t;if(t == 0) {int n,m; cin >> n >> m; n--;multiset<string> st;rep(i,m) {string a; cin >> a;st.insert(a);}A[n] = st;}if(t == 1) {string B; cin >> B;int ans = -1;rep(i,20) {if(A[i].count(B)) {A[i].erase(A[i].lower_bound(B));ans = i + 1;break;}}cout << ans << endl;}if(t == 2) {int C; cin >> C; C--;A[C].clear();}}}