結果

問題 No.2372 既視感
ユーザー 👑 p-adic
提出日時 2023-07-07 21:37:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 361 bytes
コンパイル時間 379 ms
コンパイル使用メモリ 82,012 KB
実行使用メモリ 76,988 KB
最終ジャッジ日時 2024-07-21 17:22:10
合計ジャッジ時間 2,684 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

I,R,P=input,range,print
def J():
	return map(int,I().split())
N,K,Q=J()
A=[]
M=0
for q in R(Q):
	t=I()
	if t=="1":
		A+=[I()]
		M+=1
	else:
		i,c,B=60,6,[]
		while i*c>0:
			t,d=I().split()
			d=int(d)
			for a in A[-N:]:
				if t==a:d=min(d,K)
			i,c=i-d,c-1
			B+=[t]
		P([6-c,6-c-1][i<0])
		while c>0:
			t,d=I().split()
			B+=[t]
			c-=1
		for b in B:A+=[b]
0