結果

問題 No.496 ワープクリスタル (給料日前編)
ユーザー TawaraTawara
提出日時 2016-03-07 21:32:49
言語 Python2
(2.7.18)
結果
AC  
実行時間 316 ms / 2,000 ms
コード長 250 bytes
コンパイル時間 41 ms
コンパイル使用メモリ 7,088 KB
実行使用メモリ 6,740 KB
最終ジャッジ日時 2023-10-24 20:15:42
合計ジャッジ時間 2,407 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
6,428 KB
testcase_01 AC 10 ms
6,428 KB
testcase_02 AC 9 ms
6,428 KB
testcase_03 AC 9 ms
6,428 KB
testcase_04 AC 10 ms
6,428 KB
testcase_05 AC 12 ms
6,428 KB
testcase_06 AC 12 ms
6,740 KB
testcase_07 AC 11 ms
6,428 KB
testcase_08 AC 316 ms
6,736 KB
testcase_09 AC 309 ms
6,492 KB
testcase_10 AC 12 ms
6,428 KB
testcase_11 AC 14 ms
6,432 KB
testcase_12 AC 16 ms
6,428 KB
testcase_13 AC 20 ms
6,448 KB
testcase_14 AC 32 ms
6,432 KB
testcase_15 AC 21 ms
6,496 KB
testcase_16 AC 20 ms
6,460 KB
testcase_17 AC 35 ms
6,544 KB
testcase_18 AC 30 ms
6,496 KB
testcase_19 AC 32 ms
6,536 KB
testcase_20 AC 24 ms
6,584 KB
testcase_21 AC 15 ms
6,440 KB
testcase_22 AC 117 ms
6,740 KB
testcase_23 AC 126 ms
6,740 KB
testcase_24 AC 121 ms
6,740 KB
testcase_25 AC 112 ms
6,740 KB
testcase_26 AC 122 ms
6,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

R=xrange;I=lambda:map(int,raw_input().split())
W,H,N,F=I()
dp=[[F*(i+j) for j in R(W+1)]for i in R(H+1)]
for t in R(N):
	x,y,c = I()
	for i in R(H,-1,-1):
		for j in R(W,-1,-1):
			if j>=x and i>=y:dp[i][j]=min(dp[i][j],dp[i-y][j-x]+c)
print dp[H][W]
0