結果

問題 No.2372 既視感
ユーザー aoymats1aoymats1
提出日時 2023-07-10 10:35:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 771 bytes
コンパイル時間 659 ms
コンパイル使用メモリ 86,996 KB
実行使用メモリ 78,804 KB
最終ジャッジ日時 2023-10-10 01:09:20
合計ジャッジ時間 6,291 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,456 KB
testcase_01 AC 78 ms
71,288 KB
testcase_02 AC 79 ms
71,088 KB
testcase_03 AC 81 ms
70,952 KB
testcase_04 AC 78 ms
71,108 KB
testcase_05 AC 78 ms
71,308 KB
testcase_06 AC 78 ms
71,224 KB
testcase_07 AC 78 ms
71,452 KB
testcase_08 AC 112 ms
76,804 KB
testcase_09 AC 92 ms
75,372 KB
testcase_10 AC 109 ms
76,952 KB
testcase_11 AC 120 ms
78,024 KB
testcase_12 AC 78 ms
71,452 KB
testcase_13 AC 121 ms
77,712 KB
testcase_14 AC 80 ms
71,268 KB
testcase_15 AC 100 ms
75,876 KB
testcase_16 AC 92 ms
75,584 KB
testcase_17 AC 81 ms
71,360 KB
testcase_18 AC 79 ms
71,392 KB
testcase_19 AC 77 ms
71,364 KB
testcase_20 AC 78 ms
71,296 KB
testcase_21 AC 76 ms
71,384 KB
testcase_22 AC 81 ms
70,952 KB
testcase_23 AC 120 ms
77,384 KB
testcase_24 AC 132 ms
78,804 KB
testcase_25 AC 118 ms
77,964 KB
testcase_26 AC 117 ms
77,856 KB
testcase_27 AC 120 ms
77,912 KB
testcase_28 AC 120 ms
77,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# yukicoder 2372

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
        done = []
        for i in range(6):
            t, d = input().split()
            d = int(d)

            if t in B:
                if time + min(d, K) <= 60:
                    ans += 1
                    done.append(t)
                time += min(d, K)
            else:
                if time + d <= 60:
                    ans += 1
                    done.append(t)
                time += d
    
            ## print(f'{A = } {B = } {ans = } {time = } {done = }')

        print(ans)
        A.extend(done)

0