結果

問題 No.2693 Sword
ユーザー miztommiztom
提出日時 2024-03-22 21:30:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 117 ms / 2,000 ms
コード長 267 bytes
コンパイル時間 218 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 76,312 KB
最終ジャッジ日時 2024-03-22 21:30:54
合計ジャッジ時間 2,978 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,332 KB
testcase_01 AC 37 ms
53,332 KB
testcase_02 AC 37 ms
53,332 KB
testcase_03 AC 37 ms
53,332 KB
testcase_04 AC 38 ms
53,332 KB
testcase_05 AC 36 ms
53,332 KB
testcase_06 AC 37 ms
53,332 KB
testcase_07 AC 37 ms
53,332 KB
testcase_08 AC 41 ms
53,332 KB
testcase_09 AC 55 ms
64,552 KB
testcase_10 AC 45 ms
59,504 KB
testcase_11 AC 54 ms
64,552 KB
testcase_12 AC 38 ms
53,332 KB
testcase_13 AC 53 ms
64,552 KB
testcase_14 AC 45 ms
59,472 KB
testcase_15 AC 107 ms
76,124 KB
testcase_16 AC 63 ms
68,740 KB
testcase_17 AC 88 ms
76,312 KB
testcase_18 AC 63 ms
70,776 KB
testcase_19 AC 63 ms
68,736 KB
testcase_20 AC 52 ms
64,576 KB
testcase_21 AC 54 ms
64,576 KB
testcase_22 AC 64 ms
68,748 KB
testcase_23 AC 52 ms
64,596 KB
testcase_24 AC 38 ms
53,332 KB
testcase_25 AC 37 ms
53,332 KB
testcase_26 AC 37 ms
53,332 KB
testcase_27 AC 37 ms
53,332 KB
testcase_28 AC 37 ms
53,332 KB
testcase_29 AC 37 ms
53,332 KB
testcase_30 AC 37 ms
53,332 KB
testcase_31 AC 36 ms
53,332 KB
testcase_32 AC 117 ms
75,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,p,k=map(int,input().split())
d=[p]+[-1<<60]*k
for i in range(n):
    t,b=map(int,input().split())
    if t==1:
        for j in range(k,0,-1):d[j]=max(d[j],d[j-1]+b)
    else:
        for j in range(k,0,-1):d[j]=max(d[j],d[j-1]*2)
print(-1 if d[k]>10**18 else d[k])
0