結果

問題 No.714 回転寿司屋のシミュレート
ユーザー yuruhiyayuruhiya
提出日時 2019-04-25 17:46:24
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 1,309 bytes
コンパイル時間 1,629 ms
コンパイル使用メモリ 175,932 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-30 22:26:31
合計ジャッジ時間 2,949 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 3 ms
6,940 KB
testcase_06 AC 4 ms
6,944 KB
testcase_07 AC 7 ms
6,940 KB
testcase_08 AC 10 ms
6,940 KB
testcase_09 AC 4 ms
6,940 KB
testcase_10 AC 4 ms
6,940 KB
testcase_11 AC 4 ms
6,940 KB
testcase_12 AC 4 ms
6,940 KB
testcase_13 AC 3 ms
6,940 KB
testcase_14 AC 4 ms
6,940 KB
testcase_15 AC 4 ms
6,944 KB
testcase_16 AC 3 ms
6,940 KB
testcase_17 AC 4 ms
6,944 KB
testcase_18 AC 4 ms
6,940 KB
testcase_19 AC 3 ms
6,944 KB
testcase_20 AC 4 ms
6,940 KB
testcase_21 AC 4 ms
6,940 KB
testcase_22 AC 3 ms
6,944 KB
testcase_23 AC 3 ms
6,944 KB
testcase_24 AC 3 ms
6,940 KB
testcase_25 AC 3 ms
6,940 KB
testcase_26 AC 2 ms
6,940 KB
testcase_27 AC 3 ms
6,940 KB
testcase_28 AC 3 ms
6,944 KB
testcase_29 AC 3 ms
6,944 KB
testcase_30 AC 2 ms
6,944 KB
testcase_31 AC 2 ms
6,940 KB
testcase_32 AC 2 ms
6,944 KB
testcase_33 AC 2 ms
6,940 KB
testcase_34 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, m, n) for(int i=(m); i<(n); ++i)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define Cout(x) cout << (x) << endl
#define dump(x) cerr << #x << " = " << (x) << endl;
typedef long long LL;
typedef vector<int> VI;
typedef vector<long long> VL;
typedef vector<string> VS;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
const int inf = (int)1e9;
const long long mod = (long long)1e9 + 7;
const double pi = acos(-1.0);

int main() {
	vector<pair<bool, vector<string>>> t(20);
	rep(i, 20)t[i].first = false;

	int n; cin >> n;
	rep(i, n) {
		int q; cin >> q;
		if (q == 0) {//set
			int n, m; cin >> n >> m; n--;
			t[n].first = true;
			rep(i, m) {
				string name; cin >> name;
				t[n].second.pb(name);
			}
		}
		else if (q == 1) {//susi
			string s; cin >> s;
			int ans = -1;
			rep(i, 20) {
				if (t[i].first) {
					rep(j, sz(t[i].second))if (ans == -1 && t[i].second[j] == s) {
						ans = i + 1;
						t[i].second.erase(t[i].second.begin() + j);
					}
				}
			}
			Cout(ans);
		}
		else if (q == 2) {//delete
			int c; cin >> c; c--;
			t[c].second.clear(); t[c].first = false;
		}
	}
}
0