結果

問題 No.2693 Sword
ユーザー nononnonon
提出日時 2024-03-22 22:04:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 440 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 76,136 KB
最終ジャッジ日時 2024-03-22 22:04:49
合計ジャッジ時間 2,934 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,332 KB
testcase_01 AC 36 ms
53,332 KB
testcase_02 AC 37 ms
53,332 KB
testcase_03 AC 37 ms
53,332 KB
testcase_04 AC 36 ms
53,332 KB
testcase_05 AC 36 ms
53,332 KB
testcase_06 AC 37 ms
53,332 KB
testcase_07 AC 38 ms
53,332 KB
testcase_08 AC 37 ms
53,332 KB
testcase_09 AC 58 ms
68,836 KB
testcase_10 AC 47 ms
61,720 KB
testcase_11 AC 56 ms
66,776 KB
testcase_12 AC 37 ms
53,332 KB
testcase_13 AC 54 ms
64,684 KB
testcase_14 AC 46 ms
61,720 KB
testcase_15 AC 57 ms
65,996 KB
testcase_16 AC 59 ms
66,760 KB
testcase_17 AC 73 ms
73,532 KB
testcase_18 AC 48 ms
61,728 KB
testcase_19 AC 70 ms
73,560 KB
testcase_20 AC 61 ms
68,844 KB
testcase_21 AC 56 ms
66,776 KB
testcase_22 AC 69 ms
73,028 KB
testcase_23 AC 57 ms
66,788 KB
testcase_24 AC 37 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 38 ms
53,332 KB
testcase_30 AC 38 ms
53,332 KB
testcase_31 AC 37 ms
53,332 KB
testcase_32 AC 142 ms
76,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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