結果

問題 No.2372 既視感
ユーザー yabityabit
提出日時 2023-07-11 09:43:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 577 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 87,228 KB
実行使用メモリ 78,752 KB
最終ジャッジ日時 2023-10-10 01:37:22
合計ジャッジ時間 4,387 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,320 KB
testcase_01 AC 76 ms
71,512 KB
testcase_02 AC 69 ms
71,660 KB
testcase_03 AC 70 ms
71,440 KB
testcase_04 AC 69 ms
71,316 KB
testcase_05 AC 69 ms
71,308 KB
testcase_06 AC 70 ms
71,416 KB
testcase_07 AC 71 ms
71,312 KB
testcase_08 AC 107 ms
78,332 KB
testcase_09 AC 85 ms
75,688 KB
testcase_10 AC 108 ms
78,664 KB
testcase_11 AC 115 ms
77,772 KB
testcase_12 AC 73 ms
71,312 KB
testcase_13 AC 111 ms
77,656 KB
testcase_14 AC 75 ms
71,124 KB
testcase_15 AC 91 ms
76,224 KB
testcase_16 AC 90 ms
75,584 KB
testcase_17 AC 77 ms
71,636 KB
testcase_18 AC 75 ms
71,316 KB
testcase_19 AC 75 ms
71,312 KB
testcase_20 AC 75 ms
71,388 KB
testcase_21 AC 75 ms
71,276 KB
testcase_22 AC 77 ms
71,120 KB
testcase_23 AC 121 ms
78,612 KB
testcase_24 AC 109 ms
77,912 KB
testcase_25 AC 116 ms
78,752 KB
testcase_26 AC 114 ms
78,704 KB
testcase_27 AC 115 ms
77,488 KB
testcase_28 AC 127 ms
78,048 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K,Q = map(int, input().split())
A = []
for t in range(Q):
    qu = int(input())
    if qu == 1:
        A.append(input())
        # print(A[max(0,len(A)-N):])
    else:
        B = []
        for i in range(6):
            B.append(list(input().split()))
        time = 0
        res = 0
        for n, t in B:
            t = int(t)
            if n in A[max(0,len(A)-N):]:
                time += min(t, K)
            else:
                time += t
            if time <= 60:
                res += 1
        print(res)
        for n,t in B[:res]:
            A.append(n)
0