結果

問題 No.2372 既視感
ユーザー KudeKude
提出日時 2023-07-07 21:34:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 495 bytes
コンパイル時間 443 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 78,340 KB
最終ジャッジ日時 2023-09-28 22:33:04
合計ジャッジ時間 4,325 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,540 KB
testcase_01 AC 76 ms
71,376 KB
testcase_02 AC 74 ms
71,328 KB
testcase_03 AC 75 ms
71,300 KB
testcase_04 AC 75 ms
71,356 KB
testcase_05 AC 75 ms
71,224 KB
testcase_06 AC 74 ms
71,540 KB
testcase_07 AC 75 ms
71,300 KB
testcase_08 AC 109 ms
76,656 KB
testcase_09 AC 89 ms
75,520 KB
testcase_10 AC 108 ms
76,844 KB
testcase_11 AC 116 ms
77,816 KB
testcase_12 AC 76 ms
71,220 KB
testcase_13 AC 118 ms
77,520 KB
testcase_14 AC 80 ms
71,332 KB
testcase_15 AC 98 ms
76,156 KB
testcase_16 AC 92 ms
75,140 KB
testcase_17 AC 80 ms
71,224 KB
testcase_18 AC 79 ms
71,424 KB
testcase_19 AC 76 ms
71,476 KB
testcase_20 AC 77 ms
71,364 KB
testcase_21 AC 75 ms
71,404 KB
testcase_22 AC 81 ms
71,576 KB
testcase_23 AC 120 ms
78,340 KB
testcase_24 AC 120 ms
77,612 KB
testcase_25 AC 122 ms
78,256 KB
testcase_26 AC 119 ms
77,972 KB
testcase_27 AC 120 ms
77,516 KB
testcase_28 AC 137 ms
78,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k, q = map(int, input().split())
a = []
for _ in range(q):
    if int(input()) == 1:
        s = input()
        a.append(s)
    else:
        seen = set(a[-n:])
        ans = 0
        rest = 60
        for t, d in [tuple(input().split()) for _ in range(6)]:
            d = int(d)
            x = min(d, k) if t in seen else d
            if x <= rest:
                ans += 1
                rest -= x
                a.append(t)
            else:
                break
        print(ans)
0