結果

問題 No.2372 既視感
ユーザー PNJPNJ
提出日時 2023-07-07 22:03:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 35 ms / 2,000 ms
コード長 553 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 10,956 KB
実行使用メモリ 8,696 KB
最終ジャッジ日時 2023-09-28 23:19:30
合計ジャッジ時間 2,243 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,528 KB
testcase_01 AC 18 ms
8,696 KB
testcase_02 AC 18 ms
8,616 KB
testcase_03 AC 18 ms
8,520 KB
testcase_04 AC 18 ms
8,528 KB
testcase_05 AC 19 ms
8,556 KB
testcase_06 AC 18 ms
8,612 KB
testcase_07 AC 18 ms
8,652 KB
testcase_08 AC 26 ms
8,520 KB
testcase_09 AC 22 ms
8,560 KB
testcase_10 AC 25 ms
8,640 KB
testcase_11 AC 25 ms
8,648 KB
testcase_12 AC 19 ms
8,624 KB
testcase_13 AC 28 ms
8,552 KB
testcase_14 AC 20 ms
8,644 KB
testcase_15 AC 24 ms
8,668 KB
testcase_16 AC 23 ms
8,680 KB
testcase_17 AC 20 ms
8,500 KB
testcase_18 AC 21 ms
8,628 KB
testcase_19 AC 19 ms
8,648 KB
testcase_20 AC 19 ms
8,552 KB
testcase_21 AC 18 ms
8,656 KB
testcase_22 AC 19 ms
8,624 KB
testcase_23 AC 34 ms
8,528 KB
testcase_24 AC 34 ms
8,600 KB
testcase_25 AC 34 ms
8,652 KB
testcase_26 AC 34 ms
8,696 KB
testcase_27 AC 35 ms
8,528 KB
testcase_28 AC 33 ms
8,680 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
N,K,Q = map(int,input().split())
A = deque([])
for i in range(Q):
  q = int(input())
  if q == 1:
    s = input()
    A.append(s)
    if len(A) > N:
      A.popleft()
  else:
    ans = 0
    T = 0
    f = 1
    X = []
    for i in range(6):
      t,dd = map(str,input().split())
      d = int(dd)
      if t in A:
        d = min(d,K)
      if T + d > 60:
        f = 0
      if f:
        T += d
        ans += 1
        X.append(t)
    for x in X:
      A.append(x)
      if len(A) > N:
        A.popleft()
    print(ans)
0