結果

問題 No.2372 既視感
ユーザー rlangevin
提出日時 2023-07-07 21:35:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 704 bytes
コンパイル時間 348 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 71,040 KB
最終ジャッジ日時 2024-07-21 17:19:04
合計ジャッジ時間 2,461 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

N, K, Q = map(int, input().split())
S = deque()
for _ in range(Q):
    flag = int(input())
    if flag == 1:
        S.append(input().rstrip())
    else:
        t, d = [0] * 6, [0] * 6
        for i in range(6):
            t[i], d[i] = input().split()
            
        ans = 0
        now = 0
        for i in range(6):
            if t[i] in S:
                now += min(int(d[i]), K)
            else:
                now += int(d[i])
            if now <= 60:
                ans += 1
                
        for i in range(6):
            S.append(t[i])
        print(ans)
            
    while len(S) > N:
        S.popleft()
0