結果

問題 No.2372 既視感
ユーザー lloyzlloyz
提出日時 2023-07-07 23:00:49
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 776 bytes
コンパイル時間 345 ms
コンパイル使用メモリ 86,632 KB
実行使用メモリ 78,384 KB
最終ジャッジ日時 2023-09-29 00:37:40
合計ジャッジ時間 5,112 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
71,832 KB
testcase_01 AC 100 ms
71,516 KB
testcase_02 AC 97 ms
71,880 KB
testcase_03 AC 99 ms
71,720 KB
testcase_04 AC 98 ms
71,716 KB
testcase_05 WA -
testcase_06 AC 96 ms
71,468 KB
testcase_07 AC 98 ms
71,540 KB
testcase_08 WA -
testcase_09 AC 116 ms
76,088 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 123 ms
76,760 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 104 ms
72,280 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 142 ms
77,928 KB
testcase_28 AC 145 ms
77,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque, defaultdict

n, k, q = map(int, input().split())
seen_que = deque()
seen_set = set()
seen_dict = defaultdict(int)
for _ in range(q):
    qq = int(input())
    if qq == 1:
        s = input()
        if len(seen_que) == n:
            rs = seen_que.popleft()
            seen_dict[rs] -= 1
            if seen_dict[rs] == 0:
                seen_set.remove(rs)
        seen_que.append(s)
        seen_dict[s] += 1
        seen_set.add(s)
    elif qq == 2:
        res = 0
        tt = 0
        for __ in range(6):
            s, t = input().split()
            t = int(t)
            if s in seen_set:
                tt += min(t, k)
            else:
                tt += t
            if tt <= 60:
                res += 1
        print(res)
0