結果

問題 No.2372 既視感
ユーザー aoymats1aoymats1
提出日時 2023-07-10 10:37:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 632 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 86,908 KB
実行使用メモリ 78,616 KB
最終ジャッジ日時 2023-10-10 01:09:25
合計ジャッジ時間 4,221 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,196 KB
testcase_01 AC 76 ms
71,444 KB
testcase_02 AC 75 ms
71,448 KB
testcase_03 AC 77 ms
71,440 KB
testcase_04 AC 72 ms
71,516 KB
testcase_05 AC 73 ms
71,452 KB
testcase_06 AC 74 ms
71,324 KB
testcase_07 AC 72 ms
71,312 KB
testcase_08 AC 108 ms
76,808 KB
testcase_09 AC 89 ms
75,528 KB
testcase_10 AC 109 ms
76,636 KB
testcase_11 AC 118 ms
77,624 KB
testcase_12 AC 78 ms
71,440 KB
testcase_13 AC 116 ms
77,440 KB
testcase_14 AC 79 ms
71,484 KB
testcase_15 AC 97 ms
76,220 KB
testcase_16 AC 93 ms
75,524 KB
testcase_17 AC 83 ms
71,100 KB
testcase_18 AC 81 ms
70,952 KB
testcase_19 AC 82 ms
71,264 KB
testcase_20 AC 79 ms
71,088 KB
testcase_21 AC 75 ms
71,196 KB
testcase_22 AC 78 ms
71,336 KB
testcase_23 AC 119 ms
77,344 KB
testcase_24 AC 130 ms
78,616 KB
testcase_25 AC 121 ms
77,828 KB
testcase_26 AC 117 ms
77,856 KB
testcase_27 AC 120 ms
77,936 KB
testcase_28 AC 124 ms
77,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K, Q = map(int, input().split())

A = []
for _ in range(Q):
    q = int(input())
    if q == 1:
        A.append(input())
    elif q == 2:
        M = len(A)
        B = A[max(0, M - N):]

        ans = 0
        time = 0
        for i in range(6):
            t, d = input().split()
            d = int(d)

            if t in B:
                if time + min(d, K) <= 60:
                    ans += 1
                    A.append(t)
                time += min(d, K)
            else:
                if time + d <= 60:
                    ans += 1
                    A.append(t)
                time += d

        print(ans)
0