結果

問題 No.2693 Sword
ユーザー 👑 rin204rin204
提出日時 2024-03-22 21:25:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 360 bytes
コンパイル時間 188 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 70,812 KB
最終ジャッジ日時 2024-03-22 21:25:30
合計ジャッジ時間 3,036 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,332 KB
testcase_01 AC 40 ms
53,332 KB
testcase_02 AC 38 ms
53,332 KB
testcase_03 AC 38 ms
53,332 KB
testcase_04 WA -
testcase_05 AC 37 ms
53,332 KB
testcase_06 WA -
testcase_07 AC 39 ms
53,332 KB
testcase_08 WA -
testcase_09 AC 65 ms
68,712 KB
testcase_10 AC 46 ms
61,580 KB
testcase_11 AC 56 ms
64,552 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 37 ms
53,332 KB
testcase_15 AC 47 ms
61,580 KB
testcase_16 AC 57 ms
66,652 KB
testcase_17 AC 41 ms
59,504 KB
testcase_18 AC 41 ms
59,472 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 36 ms
53,332 KB
testcase_26 WA -
testcase_27 AC 37 ms
53,332 KB
testcase_28 WA -
testcase_29 AC 37 ms
53,332 KB
testcase_30 AC 37 ms
53,332 KB
testcase_31 AC 37 ms
53,332 KB
testcase_32 AC 38 ms
53,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, p, k = map(int, input().split())
dp = [0] * (k + 1)
dp[0] = p
for _ in range(n):
    t, b = map(int, input().split())
    for i in range(k, -1, -1):
        if t == 1:
            dp[i] = max(dp[i], dp[i - 1] + b)
        else:
            dp[i] = max(dp[i], dp[i - 1] * 2)

        if dp[i] > 10**18:
            print(-1)
            exit()

print(dp[k])
0