結果

問題 No.2372 既視感
ユーザー rlangevin
提出日時 2023-07-07 21:34:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 738 bytes
コンパイル時間 248 ms
コンパイル使用メモリ 82,336 KB
実行使用メモリ 71,180 KB
最終ジャッジ日時 2024-07-21 17:18:03
合計ジャッジ時間 2,657 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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])
            
        while len(S) > N:
            S.popleft()
            
            
        print(ans)
0