結果

問題 No.496 ワープクリスタル (給料日前編)
ユーザー cielciel
提出日時 2017-04-24 00:07:17
言語 Ruby
(3.2.2)
結果
AC  
実行時間 149 ms / 2,000 ms
コード長 203 bytes
コンパイル時間 610 ms
コンパイル使用メモリ 11,448 KB
実行使用メモリ 15,528 KB
最終ジャッジ日時 2023-09-29 16:08:09
合計ジャッジ時間 3,770 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,132 KB
testcase_01 AC 78 ms
15,112 KB
testcase_02 AC 79 ms
15,272 KB
testcase_03 AC 80 ms
15,068 KB
testcase_04 AC 79 ms
15,108 KB
testcase_05 AC 80 ms
15,092 KB
testcase_06 AC 80 ms
15,504 KB
testcase_07 AC 80 ms
15,072 KB
testcase_08 AC 149 ms
15,520 KB
testcase_09 AC 148 ms
15,528 KB
testcase_10 AC 80 ms
15,232 KB
testcase_11 AC 80 ms
15,228 KB
testcase_12 AC 80 ms
15,316 KB
testcase_13 AC 81 ms
15,296 KB
testcase_14 AC 84 ms
15,212 KB
testcase_15 AC 81 ms
15,116 KB
testcase_16 AC 81 ms
15,232 KB
testcase_17 AC 84 ms
15,068 KB
testcase_18 AC 84 ms
14,988 KB
testcase_19 AC 83 ms
15,312 KB
testcase_20 AC 81 ms
15,148 KB
testcase_21 AC 79 ms
15,124 KB
testcase_22 AC 99 ms
15,380 KB
testcase_23 AC 100 ms
15,388 KB
testcase_24 AC 99 ms
15,348 KB
testcase_25 AC 96 ms
15,388 KB
testcase_26 AC 99 ms
15,520 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

w,h,n,f=gets.split.map &:to_i
m=(h+1).times.map{|i|(w+1).times.map{|j|(i+j)*f}}
n.times{
	x,y,c=gets.split.map &:to_i
	h.downto(y){|i|w.downto(x){|j|
		m[i][j]=[m[i][j],m[i-y][j-x]+c].min
	}}
}
p m[h][w]
0