結果

問題 No.2372 既視感
ユーザー i_takui_taku
提出日時 2023-07-07 21:58:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 157 ms / 2,000 ms
コード長 494 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 79,484 KB
最終ジャッジ日時 2023-09-28 23:12:40
合計ジャッジ時間 5,060 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,864 KB
testcase_01 AC 89 ms
71,820 KB
testcase_02 AC 88 ms
71,784 KB
testcase_03 AC 90 ms
71,664 KB
testcase_04 AC 92 ms
71,456 KB
testcase_05 AC 91 ms
71,488 KB
testcase_06 AC 87 ms
71,916 KB
testcase_07 AC 90 ms
71,480 KB
testcase_08 AC 130 ms
78,044 KB
testcase_09 AC 110 ms
76,680 KB
testcase_10 AC 127 ms
77,932 KB
testcase_11 AC 129 ms
77,860 KB
testcase_12 AC 91 ms
71,788 KB
testcase_13 AC 133 ms
77,752 KB
testcase_14 AC 99 ms
76,424 KB
testcase_15 AC 115 ms
77,484 KB
testcase_16 AC 109 ms
77,016 KB
testcase_17 AC 100 ms
75,956 KB
testcase_18 AC 99 ms
76,164 KB
testcase_19 AC 92 ms
71,608 KB
testcase_20 AC 97 ms
75,996 KB
testcase_21 AC 96 ms
76,228 KB
testcase_22 AC 95 ms
72,188 KB
testcase_23 AC 137 ms
78,252 KB
testcase_24 AC 134 ms
77,812 KB
testcase_25 AC 133 ms
78,336 KB
testcase_26 AC 131 ms
77,784 KB
testcase_27 AC 134 ms
78,000 KB
testcase_28 AC 157 ms
79,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque

N, K, Q = map(int, input().split())
A = deque()
for _ in range(Q):
    t = int(input())
    if t == 1:
        A.append(input())
    else:
        tot = ans = 0
        TD = [list(input().split()) for _ in range(6)]
        for t, d in TD:     
            u = int(d)
            if t in A: u = min(u, K)
            if 60 < tot + u: break
            A.append(t)
            tot += u
            ans += 1
        print(ans)
    while N < len(A): A.popleft()
    
0