結果

問題 No.424 立体迷路
ユーザー %20%20
提出日時 2018-01-06 21:16:22
言語 Perl
(5.38.2)
結果
AC  
実行時間 15 ms / 2,000 ms
コード長 429 bytes
コンパイル時間 851 ms
コンパイル使用メモリ 5,372 KB
実行使用メモリ 5,488 KB
最終ジャッジ日時 2023-09-18 17:02:49
合計ジャッジ時間 1,890 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
5,168 KB
testcase_01 AC 6 ms
5,252 KB
testcase_02 AC 6 ms
5,088 KB
testcase_03 AC 6 ms
5,384 KB
testcase_04 AC 6 ms
5,204 KB
testcase_05 AC 6 ms
5,124 KB
testcase_06 AC 6 ms
5,272 KB
testcase_07 AC 6 ms
5,252 KB
testcase_08 AC 6 ms
5,204 KB
testcase_09 AC 6 ms
5,268 KB
testcase_10 AC 6 ms
5,272 KB
testcase_11 AC 6 ms
5,260 KB
testcase_12 AC 6 ms
5,324 KB
testcase_13 AC 6 ms
5,088 KB
testcase_14 AC 6 ms
5,160 KB
testcase_15 AC 6 ms
5,112 KB
testcase_16 AC 6 ms
5,168 KB
testcase_17 AC 7 ms
5,204 KB
testcase_18 AC 7 ms
5,212 KB
testcase_19 AC 7 ms
5,292 KB
testcase_20 AC 7 ms
5,340 KB
testcase_21 AC 6 ms
5,140 KB
testcase_22 AC 7 ms
5,276 KB
testcase_23 AC 6 ms
5,196 KB
testcase_24 AC 15 ms
5,288 KB
testcase_25 AC 15 ms
5,488 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Unquoted string "b" may clash with future reserved word at Main.pl line 4.
Unquoted string "b" may clash with future reserved word at Main.pl line 4.
Unquoted string "b" may clash with future reserved word at Main.pl line 4.
Unquoted string "b" may clash with future reserved word at Main.pl line 4.
Unquoted string "b" may clash with future reserved word at Main.pl line 4.
Unquoted string "b" may clash with future reserved word at Main.pl line 4.
Name "main::h" used only once: possible typo at Main.pl line 1.
Main.pl syntax OK

ソースコード

diff #

($h,$w)=glob<>;
($sy,$sx,$gy,$gx)=glob<>;
++$sy;++$sx;++$gy;++$gx;
@b=map[map hex,b,b,/./g,b,b],(b x$w)x2,<>,(b x$w)x2;
@q=[$sy,$sx];
while(($Y,$X)=@{shift@q}){
	for([-1,0],[0,-1],[0,1],[1,0]){
		($dy,$dx)=@$_;
		if(abs($b[$Y][$X]-$b[$y=$Y+$dy][$x=$X+$dx])<=1){
			$_[$y][$x]++||push@q,[$y,$x]
		}
		if($b[$Y][$X]>$b[$y][$x] && $b[$Y][$X]==$b[$y+=$dy][$x+=$dx]){
			$_[$y][$x]++||push@q,[$y,$x]
		}
	}
}
print$_[$gy][$gx]?YES:NO
0