結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
12,160 KB
testcase_01 AC 83 ms
12,160 KB
testcase_02 AC 89 ms
12,288 KB
testcase_03 AC 107 ms
12,416 KB
testcase_04 AC 125 ms
12,544 KB
testcase_05 RE -
testcase_06 AC 147 ms
13,696 KB
testcase_07 AC 673 ms
19,584 KB
testcase_08 AC 233 ms
14,464 KB
testcase_09 AC 598 ms
18,560 KB
testcase_10 AC 81 ms
12,288 KB
testcase_11 AC 82 ms
12,160 KB
testcase_12 AC 106 ms
12,544 KB
testcase_13 AC 102 ms
12,416 KB
testcase_14 AC 129 ms
12,800 KB
testcase_15 AC 123 ms
12,800 KB
testcase_16 AC 211 ms
13,568 KB
testcase_17 AC 165 ms
13,184 KB
testcase_18 AC 182 ms
13,440 KB
testcase_19 AC 205 ms
13,696 KB
testcase_20 AC 93 ms
12,416 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