結果

問題 No.2372 既視感
ユーザー flygonflygon
提出日時 2023-07-07 21:34:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 954 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 87,248 KB
実行使用メモリ 77,996 KB
最終ジャッジ日時 2023-09-28 22:33:27
合計ジャッジ時間 4,434 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
71,664 KB
testcase_01 AC 92 ms
71,600 KB
testcase_02 AC 95 ms
71,896 KB
testcase_03 WA -
testcase_04 AC 97 ms
71,780 KB
testcase_05 AC 96 ms
71,544 KB
testcase_06 AC 94 ms
71,932 KB
testcase_07 AC 94 ms
71,608 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 114 ms
77,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(5*10**5)
input = sys.stdin.readline
from collections import defaultdict, deque, Counter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
from math import gcd

n,k,q = map(int,input().split())

a = deque()
d = defaultdict(int)

for i in range(q):
    t = int(input())
    if t == 1:
        s = input().rstrip()
        a.append(s)
        d[s] += 1
        while len(a) > n:
            d[a.popleft()] -= 1
    else:
        now = 0
        cnt = 0
        sol = []
        for i in range(6):
            l = list(input().split())
            t = int(l[1])
            if d[l[0]] >= 1:
                t = min(t, k)
            if now + t <= 60:
                now += t
                cnt += 1
                sol.append(l[0])
        for pro in sol:
            a.append(pro)
            d[pro] += 1
            while len(a) > n:
                d[a.popleft()] -= 1
        print(cnt)

0