結果

問題 No.2372 既視感
ユーザー nouka28nouka28
提出日時 2023-07-07 21:32:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 626 bytes
コンパイル時間 472 ms
コンパイル使用メモリ 87,144 KB
実行使用メモリ 78,508 KB
最終ジャッジ日時 2023-09-28 22:30:53
合計ジャッジ時間 4,026 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,308 KB
testcase_01 AC 68 ms
71,152 KB
testcase_02 AC 65 ms
71,296 KB
testcase_03 AC 67 ms
71,284 KB
testcase_04 AC 68 ms
71,308 KB
testcase_05 AC 68 ms
71,144 KB
testcase_06 AC 67 ms
71,412 KB
testcase_07 AC 68 ms
71,368 KB
testcase_08 AC 104 ms
76,684 KB
testcase_09 AC 88 ms
76,040 KB
testcase_10 AC 106 ms
76,748 KB
testcase_11 AC 107 ms
77,704 KB
testcase_12 AC 68 ms
71,280 KB
testcase_13 AC 127 ms
77,568 KB
testcase_14 AC 77 ms
75,856 KB
testcase_15 AC 92 ms
76,672 KB
testcase_16 AC 87 ms
76,208 KB
testcase_17 AC 81 ms
75,972 KB
testcase_18 AC 78 ms
75,992 KB
testcase_19 AC 75 ms
71,216 KB
testcase_20 AC 73 ms
71,512 KB
testcase_21 AC 70 ms
71,588 KB
testcase_22 AC 78 ms
75,840 KB
testcase_23 AC 116 ms
78,352 KB
testcase_24 AC 125 ms
77,716 KB
testcase_25 AC 118 ms
78,120 KB
testcase_26 AC 115 ms
78,280 KB
testcase_27 AC 117 ms
78,112 KB
testcase_28 AC 142 ms
78,508 KB
権限があれば一括ダウンロードができます

ソースコード

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]
            a.append(td[j][0])
            if ans>60:
                res=j
                a.pop()
                break
        print(res)
0