結果

問題 No.496 ワープクリスタル (給料日前編)
ユーザー TawaraTawara
提出日時 2016-07-14 22:40:05
言語 Python2
(2.7.18)
結果
AC  
実行時間 271 ms / 2,000 ms
コード長 415 bytes
コンパイル時間 328 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,656 KB
最終ジャッジ日時 2024-04-22 18:06:41
合計ジャッジ時間 2,690 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
6,144 KB
testcase_01 AC 12 ms
6,016 KB
testcase_02 AC 12 ms
6,144 KB
testcase_03 AC 13 ms
6,272 KB
testcase_04 AC 12 ms
6,016 KB
testcase_05 AC 12 ms
6,272 KB
testcase_06 AC 14 ms
6,656 KB
testcase_07 AC 12 ms
6,272 KB
testcase_08 AC 271 ms
6,528 KB
testcase_09 AC 264 ms
6,400 KB
testcase_10 AC 13 ms
6,272 KB
testcase_11 AC 14 ms
6,016 KB
testcase_12 AC 16 ms
6,144 KB
testcase_13 AC 19 ms
6,400 KB
testcase_14 AC 26 ms
6,400 KB
testcase_15 AC 19 ms
6,272 KB
testcase_16 AC 18 ms
6,272 KB
testcase_17 AC 28 ms
6,272 KB
testcase_18 AC 26 ms
6,400 KB
testcase_19 AC 27 ms
6,400 KB
testcase_20 AC 21 ms
6,400 KB
testcase_21 AC 15 ms
6,400 KB
testcase_22 AC 79 ms
6,528 KB
testcase_23 AC 87 ms
6,528 KB
testcase_24 AC 83 ms
6,528 KB
testcase_25 AC 71 ms
6,528 KB
testcase_26 AC 82 ms
6,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

R=xrange;I=lambda:map(int,raw_input().split())
Gx,Gy,N,F=I()
assert 0 <= Gx <= 100
assert 0 <= Gy <= 100
assert 0 <= N <= 50
assert 1 <= F <= 200
dp=[[F*(i+j) for j in R(Gx+1)]for i in R(Gy+1)]
for t in R(N):
	x,y,c = I()
	assert 0 <= x <= Gx
	assert 0 <= y <= Gy
	assert (x,y) != (0,0)
	assert 1 <= c <= 200
	for i in R(Gy,y-1,-1):
		for j in R(Gx,x-1,-1):
			dp[i][j]=min(dp[i][j],dp[i-y][j-x]+c)
print dp[Gy][Gx]
0