結果

問題 No.714 回転寿司屋のシミュレート
ユーザー ahe100ahe100
提出日時 2018-07-13 22:43:30
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 1,129 bytes
コンパイル時間 786 ms
コンパイル使用メモリ 82,684 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 11:19:24
合計ジャッジ時間 1,852 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<numeric>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;
typedef pair<ll, ll> mp;
ll mod = 1e9+7;
ll inf = 1e18;

//WA

int main(void){
	ll n,cnt=0;
	ll seat[100]={};
	rep(i,100)seat[i]=-1;
	map<string,ll> l[5010];
	cin>>n;
	rep(i,n){
		ll mode;
		cin>>mode;
		if(mode==0){
			ll a,b;
			cin>>a>>b;
			seat[a]=cnt;//cnt番目のlistを持つ客
			rep(j,b){
				string c;
				cin>>c;
				l[cnt][c]++;
			}
			cnt++;
		}else if(mode==1){
			string a;
			bool b=true;
			cin>>a;
			reg(j,1,20){
				if(seat[j]>=0 && l[seat[j]][a]>0){
					l[seat[j]][a]--;
					cout<<j<<endl;
					b=false;
					break;
				}
			}
			if(b)cout<<-1<<endl;
		}else{
			ll a;
			cin>>a;
			seat[a]=-1;
		}
	}
	return 0;
}
0