結果

問題 No.714 回転寿司屋のシミュレート
ユーザー tokutoku
提出日時 2019-11-02 01:52:55
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 1,555 bytes
コンパイル時間 1,321 ms
コンパイル使用メモリ 156,736 KB
実行使用メモリ 4,480 KB
最終ジャッジ日時 2023-10-13 01:06:06
合計ジャッジ時間 7,409 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>


using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0; i<int(n); i++)
#define FOR(i,m,n) for(int i=int(m); i<int(n); i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define VI vector<int>
#define VLL vector<long long>
#define VVI vector<vector<int>>
#define VVLL vector<vector<long long>>
#define VC vector<char>
#define VS vector<string>
#define VVC vector<vector<char>>
#define VB vector<bool>
#define VVB vector<vector<bool>>
#define fore(i,a) for(auto &i:a)

typedef pair <int, int> P;
template<class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
const int  INF = 1 << 29;
const ll INFL = 1LL << 60;
const ll mod = 1000000007;





int main() {
	int n;
	cin >> n;
	vector<vector<string>> v(25);
	VI w(25, -1);
	VVB che(25, VB(25, false));

	REP(_, n) {
		int a;
		cin >> a;
		if (a == 2) {
			int b;
			cin >> b;
			b--;
			w[b] = -1;
			REP(i, 25)che[b][i] = false;
			REP(i, 25)v[b][i] = "__";
		}
		else if (a == 1) {
			string s;
			cin >> s;
			int ans = -2;
			REP(i, 20) {
				if (ans != -2)break;
				if (w[i] != -1) {
					REP(j, w[i]) {
						if (v[i][j] == s && che[i][j]) {
							che[i][j] = false;
							ans = i;
							break;
						}
					}
				}
			}
			cout << ans+1 << endl;
		}
		else {
			int aa;
			cin >> aa;
			aa--;
			int m;
			cin >> m;
			w[aa] = m;
			REP(i, m) {
				string s;
				cin >> s;
				v[aa].push_back(s);
				che[aa][i] = true;
			}
		}
	}
}
0