結果

問題 No.658 テトラナッチ数列 Hard
ユーザー %20%20
提出日時 2018-03-02 22:55:07
言語 Perl
(5.38.2)
結果
TLE  
実行時間 -
コード長 352 bytes
コンパイル時間 211 ms
コンパイル使用メモリ 5,324 KB
実行使用メモリ 8,976 KB
最終ジャッジ日時 2023-09-04 05:37:36
合計ジャッジ時間 3,949 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
8,976 KB
testcase_01 AC 10 ms
4,568 KB
testcase_02 AC 13 ms
4,528 KB
testcase_03 AC 137 ms
4,580 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

sub f{my@r;
	for$y(0..3){
		for$x(0..3){
			for(0..3){
				($r[4*$y+$x]+=$Z[4*$y+$_]*$_[4*$_+$x])%=17
			}
		}
	}
	@Z=@r
}

<>;
for(<>){
	$n=$_-1;
	@Z=(1,0,0,0,
	    0,1,0,0,
	    0,0,1,0,
	    0,0,0,1);
	f(@Z),$n>>$_&1&&f(1,1,1,1,
	                  1,0,0,0,
	                  0,1,0,0,
	                  0,0,1,0)for reverse 0..59;
	print$Z[12],$/
}
0