結果

問題 No.2372 既視感
コンテスト
ユーザー i_taku
提出日時 2023-07-07 21:58:59
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 494 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 164 ms
コンパイル使用メモリ 85,444 KB
実行使用メモリ 82,176 KB
最終ジャッジ日時 2026-04-03 05:30:49
合計ジャッジ時間 4,657 ms
ジャッジサーバーID
(参考情報)
judge5_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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