結果

問題 No.2372 既視感
ユーザー prd_xxxprd_xxx
提出日時 2023-07-07 21:32:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 677 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 87,296 KB
実行使用メモリ 79,532 KB
最終ジャッジ日時 2023-09-28 22:30:25
合計ジャッジ時間 4,645 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
71,408 KB
testcase_01 AC 89 ms
71,812 KB
testcase_02 AC 87 ms
71,812 KB
testcase_03 AC 93 ms
71,700 KB
testcase_04 AC 89 ms
71,804 KB
testcase_05 WA -
testcase_06 AC 94 ms
71,432 KB
testcase_07 AC 87 ms
71,428 KB
testcase_08 WA -
testcase_09 AC 103 ms
76,600 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 115 ms
77,708 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 96 ms
72,040 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 133 ms
77,828 KB
testcase_28 AC 162 ms
79,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K,Q = map(int,input().split())
from collections import deque
q = deque()

for _ in range(Q):
    t = int(input())
    if t==1:
        s = input()
        q.append(s)
        if len(q) > N:
            q.popleft()
    else:
        TD = [input().split() for i in range(6)]
        ans = 0
        rem = 60
        for s,d in TD:
            d = int(d)
            time = d
            if s in q:
                time = min(d,K)
            if rem >= time:
                rem -= time
                ans += 1
            else:
                break
        for i in range(ans):
            q.append(s)
            if len(q) > N:
                q.popleft()
        print(ans)
0