結果

問題 No.1292 パタパタ三角形
ユーザー tailstails
提出日時 2020-11-20 23:03:12
言語 Perl
(5.38.0)
結果
AC  
実行時間 541 ms / 2,000 ms
コード長 198 bytes
コンパイル時間 455 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 48,080 KB
最終ジャッジ日時 2023-09-30 19:52:11
合計ジャッジ時間 6,169 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,600 KB
testcase_01 AC 3 ms
4,584 KB
testcase_02 AC 2 ms
4,760 KB
testcase_03 AC 2 ms
4,776 KB
testcase_04 AC 3 ms
4,676 KB
testcase_05 AC 3 ms
4,792 KB
testcase_06 AC 2 ms
4,488 KB
testcase_07 AC 445 ms
27,340 KB
testcase_08 AC 442 ms
27,224 KB
testcase_09 AC 530 ms
47,156 KB
testcase_10 AC 528 ms
46,692 KB
testcase_11 AC 541 ms
46,580 KB
testcase_12 AC 488 ms
48,080 KB
testcase_13 AC 498 ms
47,836 KB
testcase_14 AC 488 ms
22,000 KB
testcase_15 AC 215 ms
21,732 KB
testcase_16 AC 506 ms
21,924 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Unquoted string "a" may clash with future reserved word at Main.pl line 10.
Unquoted string "b" may clash with future reserved word at Main.pl line 10.
Name "main::h" used only once: possible typo at Main.pl line 7.
Main.pl syntax OK

ソースコード

diff #

@a=(0,1,-1);
@b=(1,0,0);
for(0,<>=~/./g){
	$i=(3&ord)-1;
	$x+=$a[$i];
	$y+=$b[$i];
	$\+=!$h{$x,$y}++;
	$b[$i]*=-1;
	if($a[$i]){
		@$_[$i-1,$i-2]=@$_[$i-2,$i-1]for a,b;
		$_=-$_ for@a,@b;
	}
}
print
0