結果

問題 No.34 砂漠の行商人
ユーザー letrangerjpletrangerjp
提出日時 2017-06-14 02:12:36
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 266 bytes
コンパイル時間 552 ms
コンパイル使用メモリ 11,872 KB
実行使用メモリ 19,380 KB
最終ジャッジ日時 2023-10-24 21:56:42
合計ジャッジ時間 6,238 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
16,096 KB
testcase_01 WA -
testcase_02 AC 91 ms
16,096 KB
testcase_03 AC 87 ms
16,096 KB
testcase_04 AC 125 ms
16,452 KB
testcase_05 AC 136 ms
16,640 KB
testcase_06 AC 116 ms
16,460 KB
testcase_07 WA -
testcase_08 AC 230 ms
17,292 KB
testcase_09 AC 191 ms
17,128 KB
testcase_10 AC 121 ms
16,932 KB
testcase_11 AC 157 ms
17,500 KB
testcase_12 AC 99 ms
16,308 KB
testcase_13 AC 395 ms
19,380 KB
testcase_14 AC 391 ms
19,380 KB
testcase_15 AC 91 ms
16,212 KB
testcase_16 AC 119 ms
16,460 KB
testcase_17 AC 91 ms
16,288 KB
testcase_18 AC 95 ms
16,096 KB
testcase_19 AC 210 ms
17,384 KB
testcase_20 AC 282 ms
18,112 KB
testcase_21 WA -
testcase_22 AC 100 ms
16,448 KB
testcase_23 AC 93 ms
16,212 KB
testcase_24 AC 318 ms
18,376 KB
testcase_25 AC 121 ms
16,564 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

eval"N,V,X,Y,*Z="+gets.split*?,
L=$<.map{|s|s.split.map(&:to_i)+M=[9e9]}+[M*N]
v={}
v[[X,Y]]=V
q=v.dup
i=0
(i+=1
z={}
q.map{|(x,y),h|[[x+1,y],[x-1,y],[x,y+1],[x,y-1]].map{|a,b|Z==x ?(p i;exit):z[x]=v[x]=y if(y=h-L[b-1][a-1])>0&&y>(v[x=[a,b]]||0)}}
q=z)until q.empty?
0