結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,532 KB
testcase_01 AC 18 ms
8,460 KB
testcase_02 AC 18 ms
8,680 KB
testcase_03 AC 18 ms
8,628 KB
testcase_04 AC 18 ms
8,616 KB
testcase_05 AC 19 ms
8,672 KB
testcase_06 WA -
testcase_07 AC 18 ms
8,608 KB
testcase_08 AC 25 ms
8,680 KB
testcase_09 AC 22 ms
8,536 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 19 ms
8,576 KB
testcase_13 AC 28 ms
8,660 KB
testcase_14 AC 20 ms
8,700 KB
testcase_15 AC 23 ms
8,668 KB
testcase_16 AC 23 ms
8,584 KB
testcase_17 AC 19 ms
8,668 KB
testcase_18 AC 19 ms
8,680 KB
testcase_19 AC 19 ms
8,684 KB
testcase_20 AC 18 ms
8,568 KB
testcase_21 AC 18 ms
8,672 KB
testcase_22 AC 19 ms
8,500 KB
testcase_23 AC 35 ms
8,532 KB
testcase_24 AC 35 ms
8,656 KB
testcase_25 AC 36 ms
8,528 KB
testcase_26 AC 36 ms
8,688 KB
testcase_27 AC 36 ms
8,528 KB
testcase_28 AC 32 ms
8,564 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()
    if s not in A:
      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