結果

問題 No.20 砂漠のオアシス
ユーザー letrangerjpletrangerjp
提出日時 2017-06-03 20:54:11
言語 Ruby
(3.3.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 331 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 11,444 KB
実行使用メモリ 21,496 KB
最終ジャッジ日時 2023-08-03 08:22:59
合計ジャッジ時間 4,485 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
15,108 KB
testcase_01 AC 75 ms
15,120 KB
testcase_02 AC 76 ms
15,080 KB
testcase_03 AC 86 ms
15,348 KB
testcase_04 AC 113 ms
15,724 KB
testcase_05 RE -
testcase_06 AC 125 ms
16,412 KB
testcase_07 AC 615 ms
21,496 KB
testcase_08 AC 202 ms
17,220 KB
testcase_09 AC 535 ms
21,144 KB
testcase_10 AC 71 ms
15,068 KB
testcase_11 AC 73 ms
15,288 KB
testcase_12 AC 94 ms
15,476 KB
testcase_13 AC 90 ms
15,696 KB
testcase_14 AC 111 ms
15,648 KB
testcase_15 AC 104 ms
15,688 KB
testcase_16 AC 181 ms
16,848 KB
testcase_17 AC 148 ms
16,276 KB
testcase_18 AC 158 ms
16,488 KB
testcase_19 AC 187 ms
16,908 KB
testcase_20 AC 80 ms
15,312 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

eval"N,V,X,Y="+gets.split*?,
L=$<.map{|s|s.split.map(&:to_i)+M=[1e3]}+[M*N]
d={k=[0,0,1]=>V}
q=[[V]+k]
while(h,x,y,o=q.pop)
x+y>N*2-3&&$><<:YES|exit
[x,y,o]==[X-1,Y-1,1]&&(h*=2;o=0)
[[x+1,y],[x,y+1],[x-1,y],[x,y-1]].map{|a,b|(0<i=h-L[b][a])&&!d[k=[a,b,o]]&&(d[k]=i;e=[i]+k;q[q.bsearch_index{|v|0.<v<=>e}||q.size,0]=[e])}end
$><<:NO
0