結果

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

ソースコード

diff #

n,k,q=map(int,input().split())
a=[]
for i in range(q):
    t=int(input())
    if t==1:
        s=input()
        a.append(s)
    if t==2:
        td=[input().split()for i in range(6)]
        for j in range(6):td[j][1]=int(td[j][1])
        recent=set()
        for i in range(n):
            try:recent.add(a[-i-1])
            except:break    
        ans=0
        res=6
        for j in range(6):
            if td[j][0]in recent:ans+=min(k,td[j][1])
            else:ans+=td[j][1]
            if ans>60:
                res=j
                break
        for j in range(6):a.append(td[j][0])
        print(res)
0