結果

問題 No.2372 既視感
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2023-07-07 22:13:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 535 bytes
コンパイル時間 1,747 ms
コンパイル使用メモリ 86,780 KB
実行使用メモリ 79,168 KB
最終ジャッジ日時 2023-09-28 23:34:41
合計ジャッジ時間 5,931 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,132 KB
testcase_01 AC 76 ms
71,432 KB
testcase_02 AC 74 ms
71,304 KB
testcase_03 AC 73 ms
71,148 KB
testcase_04 AC 74 ms
71,248 KB
testcase_05 AC 75 ms
71,284 KB
testcase_06 AC 74 ms
71,408 KB
testcase_07 AC 73 ms
71,540 KB
testcase_08 AC 124 ms
78,308 KB
testcase_09 AC 91 ms
75,776 KB
testcase_10 AC 115 ms
78,296 KB
testcase_11 AC 119 ms
77,760 KB
testcase_12 AC 79 ms
75,108 KB
testcase_13 AC 125 ms
78,364 KB
testcase_14 AC 85 ms
75,132 KB
testcase_15 AC 100 ms
76,164 KB
testcase_16 AC 95 ms
75,892 KB
testcase_17 AC 85 ms
75,108 KB
testcase_18 AC 81 ms
75,356 KB
testcase_19 AC 77 ms
71,296 KB
testcase_20 AC 78 ms
74,972 KB
testcase_21 AC 78 ms
75,184 KB
testcase_22 AC 81 ms
75,276 KB
testcase_23 AC 121 ms
78,260 KB
testcase_24 AC 135 ms
79,168 KB
testcase_25 AC 121 ms
77,516 KB
testcase_26 AC 119 ms
77,576 KB
testcase_27 AC 124 ms
78,784 KB
testcase_28 AC 128 ms
77,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,K,q = map(int,input().split())
A = [0]*(n+1)
for _ in range(q):
    t = int(input())
    if t == 1:
        A.append(input())
        continue

    left = 60
    record = A[-n:]
    TD = []
    for i in range(6):
        t,d = input().split()
        TD.append([t,int(d)])
    # print(record)
    ans = 0
    for i in range(6):
        t,d = TD[i]
        if t in record:
            d = min(d,K)
        if d <= left:
            ans += 1
            left -= d
            A.append(t)
        else:
            break
    print(ans)
0