結果

問題 No.2693 Sword
ユーザー KamikazeeKamikazee
提出日時 2024-02-01 16:16:14
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 502 bytes
コンパイル時間 344 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 142,400 KB
最終ジャッジ日時 2024-02-09 13:34:52
合計ジャッジ時間 3,030 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
53,332 KB
testcase_01 AC 30 ms
53,332 KB
testcase_02 AC 32 ms
53,332 KB
testcase_03 WA -
testcase_04 AC 30 ms
53,332 KB
testcase_05 AC 30 ms
53,332 KB
testcase_06 AC 29 ms
53,332 KB
testcase_07 AC 30 ms
53,332 KB
testcase_08 AC 32 ms
53,332 KB
testcase_09 AC 65 ms
72,832 KB
testcase_10 AC 41 ms
63,800 KB
testcase_11 AC 58 ms
70,788 KB
testcase_12 AC 33 ms
53,332 KB
testcase_13 AC 48 ms
66,640 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 74 ms
77,760 KB
testcase_20 AC 57 ms
72,884 KB
testcase_21 AC 57 ms
72,868 KB
testcase_22 AC 65 ms
74,524 KB
testcase_23 AC 58 ms
72,876 KB
testcase_24 AC 30 ms
53,332 KB
testcase_25 WA -
testcase_26 AC 30 ms
53,332 KB
testcase_27 WA -
testcase_28 AC 31 ms
53,332 KB
testcase_29 AC 33 ms
53,332 KB
testcase_30 AC 31 ms
53,332 KB
testcase_31 AC 31 ms
53,332 KB
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,p,k = map(int, input().split())

dp = [[0 for i in range(k + 1)] for i in range(n + 1)]
dp[0][0] = p
# dp[i][j] = i 番目のエンブレムまで使えて j 種類装備しているときの最大攻撃力

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