結果

問題 No.2372 既視感
ユーザー titia
提出日時 2023-07-09 03:26:07
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 49 ms / 2,000 ms
コード長 576 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-07-22 23:46:37
合計ジャッジ時間 2,057 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K,Q=map(int,input().split())
A=[]

for tests in range(Q):
    x=int(input())
    if x==1:
        s=input()
        A.append(s)
    else:
        X=[]
        now=0

        U=[input().split() for i in range(6)]

        for tests in range(6):
            x,y=U[tests]
            y=int(y)

            if x in A[max(0,len(A)-N):]:
                now+=min(K,y)
            else:
                now+=y

            if now<=60:
                X.append(x)
            else:
                print(tests)
                break
        else:
            print(6)

        A+=X
0