結果

問題 No.20 砂漠のオアシス
ユーザー letrangerjpletrangerjp
提出日時 2017-06-03 20:26:29
言語 Ruby
(3.3.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 355 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 19,456 KB
最終ジャッジ日時 2024-04-21 07:13:13
合計ジャッジ時間 4,694 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
12,160 KB
testcase_01 AC 81 ms
12,288 KB
testcase_02 AC 81 ms
12,288 KB
testcase_03 AC 99 ms
12,672 KB
testcase_04 AC 118 ms
12,672 KB
testcase_05 RE -
testcase_06 AC 138 ms
13,568 KB
testcase_07 AC 666 ms
19,456 KB
testcase_08 AC 232 ms
14,464 KB
testcase_09 AC 599 ms
19,328 KB
testcase_10 AC 83 ms
12,160 KB
testcase_11 AC 83 ms
12,160 KB
testcase_12 AC 104 ms
12,544 KB
testcase_13 AC 98 ms
12,416 KB
testcase_14 AC 125 ms
12,928 KB
testcase_15 AC 120 ms
12,928 KB
testcase_16 AC 211 ms
13,568 KB
testcase_17 AC 171 ms
13,312 KB
testcase_18 AC 185 ms
13,696 KB
testcase_19 AC 209 ms
13,696 KB
testcase_20 AC 90 ms
12,416 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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