結果
問題 | No.2693 Sword |
ユーザー |
![]() |
提出日時 | 2024-03-28 00:07:13 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 598 ms / 2,000 ms |
コード長 | 348 bytes |
コンパイル時間 | 129 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-09-30 14:39:23 |
合計ジャッジ時間 | 3,298 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 29 |
ソースコード
import sysinput = sys.stdin.readlineN,P,K=map(int,input().split())DP=[0]*(K+1)DP[0]=Pfor i in range(N):t,b=map(int,input().split())for j in range(K-1,-1,-1):if t==1:DP[j+1]=max(DP[j+1],DP[j]+b)else:DP[j+1]=max(DP[j+1],DP[j]*2)if DP[-1]>10**18:print(-1)else:print(DP[-1])