結果

問題 No.2372 既視感
ユーザー prd_xxxprd_xxx
提出日時 2023-07-07 21:36:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 145 ms / 2,000 ms
コード長 684 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 86,980 KB
実行使用メモリ 79,208 KB
最終ジャッジ日時 2023-09-28 22:35:41
合計ジャッジ時間 4,737 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
71,544 KB
testcase_01 AC 91 ms
71,596 KB
testcase_02 AC 88 ms
71,600 KB
testcase_03 AC 91 ms
71,660 KB
testcase_04 AC 92 ms
71,920 KB
testcase_05 AC 89 ms
71,600 KB
testcase_06 AC 92 ms
71,608 KB
testcase_07 AC 90 ms
71,796 KB
testcase_08 AC 124 ms
77,920 KB
testcase_09 AC 108 ms
76,564 KB
testcase_10 AC 125 ms
78,120 KB
testcase_11 AC 140 ms
77,552 KB
testcase_12 AC 92 ms
71,604 KB
testcase_13 AC 131 ms
77,712 KB
testcase_14 AC 99 ms
76,124 KB
testcase_15 AC 114 ms
77,308 KB
testcase_16 AC 111 ms
76,844 KB
testcase_17 AC 98 ms
76,220 KB
testcase_18 AC 99 ms
76,168 KB
testcase_19 AC 93 ms
71,748 KB
testcase_20 AC 96 ms
76,204 KB
testcase_21 AC 96 ms
76,080 KB
testcase_22 AC 96 ms
72,340 KB
testcase_23 AC 139 ms
78,168 KB
testcase_24 AC 135 ms
78,016 KB
testcase_25 AC 136 ms
78,076 KB
testcase_26 AC 132 ms
77,860 KB
testcase_27 AC 133 ms
78,012 KB
testcase_28 AC 145 ms
79,208 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(TD[i][0])
            if len(q) > N:
                q.popleft()
        print(ans)
0