結果

問題 No.1292 パタパタ三角形
ユーザー tails
提出日時 2020-11-20 23:03:12
言語 Perl
(5.40.0)
結果
AC  
実行時間 527 ms / 2,000 ms
コード長 198 bytes
コンパイル時間 343 ms
コンパイル使用メモリ 6,816 KB
実行使用メモリ 52,992 KB
最終ジャッジ日時 2024-07-23 13:40:05
合計ジャッジ時間 5,553 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
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