結果

問題 No.2372 既視感
ユーザー miho-4miho-4
提出日時 2023-07-08 00:40:43
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 515 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 77,440 KB
最終ジャッジ日時 2024-07-21 21:02:23
合計ジャッジ時間 3,442 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
53,888 KB
testcase_01 AC 41 ms
54,016 KB
testcase_02 AC 42 ms
53,632 KB
testcase_03 WA -
testcase_04 AC 41 ms
53,632 KB
testcase_05 AC 43 ms
54,144 KB
testcase_06 AC 42 ms
53,632 KB
testcase_07 AC 42 ms
53,760 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 102 ms
76,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
n,k,q=map(int,input().split())

que=deque([0]*n)

for _ in range(q):
  q1=int(input())
  if q1==1:
    s=input()
    que.append(s)
    que.popleft()
  else:
    Q=[list(input().split()) for _ in range(6)]
    
    sum_d,ans=0,0
    solved=[]
    for t,d in Q:
      d=int(d)
      if t in que:
        d=min(d,k)
      if sum_d+d<=60:
        sum_d+=d
        ans+=1
        solved.append(t)
        
    for t in solved:
      que.append(t)
      que.popleft()
        
    print(ans)
0