結果

問題 No.714 回転寿司屋のシミュレート
ユーザー RTIA1227RTIA1227
提出日時 2018-07-13 22:51:46
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 9 ms / 2,000 ms
コード長 1,208 bytes
コンパイル時間 882 ms
コンパイル使用メモリ 82,688 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-07-30 09:56:06
合計ジャッジ時間 2,139 ms
ジャッジサーバーID
(参考情報)
judge13 / judge5
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<stack>
#include<set>
#include<climits>
#include<cstdlib>
#include<cmath>
#include<string>

using namespace std;

#define INF 1 << 29
#define LL long long int

LL const MOD = 1000000007;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    vector<bool> onkyaku(21,false);
	vector<vector<string>> eatlist(21);

	LL n;
	cin >> n;

	for(int i = 0; i < n; i++){
		LL d;
		cin >> d;
		if(d == 0){
			LL ind;
			cin >> ind;
			LL listnum;
			cin >> listnum;
			for(int j = 0; j < listnum; j++){
				string inp;
				cin >> inp;
				eatlist[ind].push_back(inp);
				onkyaku[ind] = true;
			}
		}else if(d == 1){
			string str;
			cin >> str;
			bool frag = true;
			LL out = -1;
			for(int j = 1; frag && j < 21; j++){
				if(onkyaku[j]){
					for(int k = 0;frag && k < eatlist[j].size(); k++){
						if(str == eatlist[j][k]){
							out = j;
							frag = false;
							eatlist[j].erase(eatlist[j].begin() + k);
						}
					}
				}
			}
			cout << out << endl;
		}else{
			LL c;
			cin >> c;
			while(eatlist[c].size() > 0){
				eatlist[c].erase(eatlist[c].begin());
			}
		}
	}
    
    return 0;
}
0