結果

問題 No.331 CodeRunnerでやれ
ユーザー tailstails
提出日時 2015-12-24 00:36:53
言語 Perl
(5.38.2)
結果
AC  
実行時間 288 ms / 5,000 ms
コード長 264 bytes
コンパイル時間 140 ms
コンパイル使用メモリ 5,336 KB
実行使用メモリ 24,240 KB
平均クエリ数 293.65
最終ジャッジ日時 2023-09-23 22:39:38
合計ジャッジ時間 5,331 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
23,884 KB
testcase_01 AC 141 ms
23,200 KB
testcase_02 AC 155 ms
24,228 KB
testcase_03 AC 165 ms
24,240 KB
testcase_04 AC 157 ms
23,368 KB
testcase_05 AC 146 ms
23,256 KB
testcase_06 AC 203 ms
23,652 KB
testcase_07 AC 164 ms
23,380 KB
testcase_08 AC 195 ms
23,500 KB
testcase_09 AC 259 ms
23,664 KB
testcase_10 AC 248 ms
24,208 KB
testcase_11 AC 214 ms
23,548 KB
testcase_12 AC 209 ms
23,392 KB
testcase_13 AC 233 ms
24,220 KB
testcase_14 AC 249 ms
23,680 KB
testcase_15 AC 249 ms
23,476 KB
testcase_16 AC 288 ms
23,632 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

$|=1;
sub i{$_=<>;/M/&&exit;$_+0}
sub o{print"@_\n"}
while(1){
	$d=$d+1&3,o L while!i;
	$x1=$x+(1,0,-1,0)[$d];
	$y1=$y+(0,1,0,-1)[$d];
	if($m{$x1,$y1}==0||$m{$x1,$y1}==($d^6)){
		$m{$x,$y}=$d^4;
		$x=$x1;$y=$y1;o F;i;
		$d=$d-1&3,o R;
	}else{
		$d=$d+1&3,o L;
	}
}
0