結果

問題 No.2372 既視感
ユーザー shogo314shogo314
提出日時 2023-07-07 22:37:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 528 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 87,204 KB
実行使用メモリ 78,640 KB
最終ジャッジ日時 2023-09-29 00:09:03
合計ジャッジ時間 4,513 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,388 KB
testcase_01 AC 76 ms
71,336 KB
testcase_02 AC 77 ms
71,360 KB
testcase_03 AC 78 ms
71,368 KB
testcase_04 AC 78 ms
71,552 KB
testcase_05 AC 77 ms
71,552 KB
testcase_06 AC 78 ms
71,272 KB
testcase_07 AC 78 ms
71,572 KB
testcase_08 AC 117 ms
78,372 KB
testcase_09 AC 92 ms
75,320 KB
testcase_10 AC 111 ms
77,112 KB
testcase_11 AC 121 ms
77,936 KB
testcase_12 AC 78 ms
71,276 KB
testcase_13 AC 125 ms
78,204 KB
testcase_14 AC 82 ms
71,116 KB
testcase_15 AC 101 ms
76,120 KB
testcase_16 AC 95 ms
75,640 KB
testcase_17 AC 84 ms
71,276 KB
testcase_18 AC 83 ms
71,388 KB
testcase_19 AC 80 ms
71,444 KB
testcase_20 AC 80 ms
71,132 KB
testcase_21 AC 79 ms
71,292 KB
testcase_22 AC 82 ms
71,624 KB
testcase_23 AC 126 ms
77,488 KB
testcase_24 AC 122 ms
78,132 KB
testcase_25 AC 123 ms
78,640 KB
testcase_26 AC 121 ms
77,468 KB
testcase_27 AC 124 ms
77,568 KB
testcase_28 AC 138 ms
77,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K, Q = map(int, input().split())
A = []
for _ in range(Q):
    q = int(input())
    if q == 1:
        A.append(input())
    else:
        td = [tuple(input().split()) for i in range(6)]
        x = 0
        ans = 0
        l=[]
        for t, d in td:
            y = int(d)
            if t in A[-N:]:
                y = min(K, y)
            if x+y <= 60:
                ans += 1
                l.append(t)
            x += y
            # print(f'{x=}')
        print(ans)
        for t in l:
            A.append(t)
0