結果

問題 No.496 ワープクリスタル (給料日前編)
ユーザー TawaraTawara
提出日時 2016-03-07 22:40:08
言語 Python2
(2.7.18)
結果
AC  
実行時間 263 ms / 2,000 ms
コード長 235 bytes
コンパイル時間 44 ms
コンパイル使用メモリ 7,084 KB
実行使用メモリ 6,732 KB
最終ジャッジ日時 2023-10-24 18:39:48
合計ジャッジ時間 2,013 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
6,420 KB
testcase_01 AC 10 ms
6,420 KB
testcase_02 AC 10 ms
6,420 KB
testcase_03 AC 10 ms
6,420 KB
testcase_04 AC 10 ms
6,420 KB
testcase_05 AC 10 ms
6,420 KB
testcase_06 AC 12 ms
6,732 KB
testcase_07 AC 10 ms
6,420 KB
testcase_08 AC 263 ms
6,728 KB
testcase_09 AC 262 ms
6,488 KB
testcase_10 AC 12 ms
6,420 KB
testcase_11 AC 12 ms
6,424 KB
testcase_12 AC 13 ms
6,420 KB
testcase_13 AC 17 ms
6,440 KB
testcase_14 AC 24 ms
6,424 KB
testcase_15 AC 17 ms
6,488 KB
testcase_16 AC 16 ms
6,452 KB
testcase_17 AC 26 ms
6,536 KB
testcase_18 AC 23 ms
6,488 KB
testcase_19 AC 25 ms
6,528 KB
testcase_20 AC 19 ms
6,576 KB
testcase_21 AC 13 ms
6,436 KB
testcase_22 AC 76 ms
6,732 KB
testcase_23 AC 84 ms
6,732 KB
testcase_24 AC 78 ms
6,732 KB
testcase_25 AC 68 ms
6,732 KB
testcase_26 AC 78 ms
6,732 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,y-1,-1):
		for j in R(W,x-1,-1):
			dp[i][j]=min(dp[i][j],dp[i-y][j-x]+c)
print dp[H][W]
0