結果

問題 No.2693 Sword
ユーザー aa
提出日時 2024-03-29 20:18:33
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 354 bytes
コンパイル時間 975 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 73,400 KB
最終ジャッジ日時 2024-03-29 20:18:38
合計ジャッジ時間 4,162 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,332 KB
testcase_01 AC 36 ms
53,332 KB
testcase_02 AC 36 ms
53,332 KB
testcase_03 AC 36 ms
53,332 KB
testcase_04 AC 35 ms
53,332 KB
testcase_05 AC 35 ms
53,332 KB
testcase_06 AC 34 ms
53,332 KB
testcase_07 AC 35 ms
53,332 KB
testcase_08 AC 36 ms
53,332 KB
testcase_09 AC 59 ms
68,660 KB
testcase_10 AC 46 ms
61,728 KB
testcase_11 AC 56 ms
66,612 KB
testcase_12 AC 36 ms
53,332 KB
testcase_13 AC 53 ms
66,640 KB
testcase_14 AC 38 ms
58,864 KB
testcase_15 AC 49 ms
63,780 KB
testcase_16 AC 60 ms
70,804 KB
testcase_17 AC 44 ms
63,612 KB
testcase_18 AC 42 ms
61,572 KB
testcase_19 AC 70 ms
73,400 KB
testcase_20 AC 55 ms
66,636 KB
testcase_21 AC 59 ms
68,716 KB
testcase_22 AC 72 ms
72,876 KB
testcase_23 AC 54 ms
66,676 KB
testcase_24 WA -
testcase_25 AC 35 ms
53,332 KB
testcase_26 AC 35 ms
53,332 KB
testcase_27 AC 35 ms
53,332 KB
testcase_28 AC 36 ms
53,332 KB
testcase_29 AC 36 ms
53,332 KB
testcase_30 AC 36 ms
53,332 KB
testcase_31 AC 36 ms
53,332 KB
testcase_32 AC 43 ms
67,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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