結果

問題 No.2372 既視感
ユーザー ニックネームニックネーム
提出日時 2023-07-07 21:34:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 35 ms / 2,000 ms
コード長 429 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,964 KB
実行使用メモリ 8,660 KB
最終ジャッジ日時 2023-09-28 22:33:14
合計ジャッジ時間 2,030 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,600 KB
testcase_01 AC 19 ms
8,492 KB
testcase_02 AC 18 ms
8,608 KB
testcase_03 AC 18 ms
8,488 KB
testcase_04 AC 18 ms
8,600 KB
testcase_05 AC 20 ms
8,516 KB
testcase_06 AC 19 ms
8,492 KB
testcase_07 AC 19 ms
8,468 KB
testcase_08 AC 26 ms
8,652 KB
testcase_09 AC 22 ms
8,500 KB
testcase_10 AC 25 ms
8,504 KB
testcase_11 AC 25 ms
8,628 KB
testcase_12 AC 20 ms
8,644 KB
testcase_13 AC 28 ms
8,496 KB
testcase_14 AC 20 ms
8,636 KB
testcase_15 AC 24 ms
8,616 KB
testcase_16 AC 23 ms
8,568 KB
testcase_17 AC 21 ms
8,544 KB
testcase_18 AC 20 ms
8,660 KB
testcase_19 AC 20 ms
8,596 KB
testcase_20 AC 20 ms
8,520 KB
testcase_21 AC 20 ms
8,656 KB
testcase_22 AC 20 ms
8,496 KB
testcase_23 AC 35 ms
8,572 KB
testcase_24 AC 33 ms
8,556 KB
testcase_25 AC 34 ms
8,556 KB
testcase_26 AC 35 ms
8,584 KB
testcase_27 AC 34 ms
8,584 KB
testcase_28 AC 32 ms
8,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
n,k,q = map(int,input().split())
a = deque()
for _ in range(q):
    if int(input())==1:
        a.append(input())
        if len(a)>n: a.popleft()
    else:
        s = c = 0
        for _ in range(6):
            t,d = input().split(); d = int(d)
            if t in a: d = min(d,k)
            if s+d<=60: a.append(t); c += 1
            s += d
        while len(a)>n: a.popleft()
        print(c)
0