結果

問題 No.657 テトラナッチ数列 Easy
ユーザー StarMatyanStarMatyan
提出日時 2018-07-25 19:49:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 379 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 10,672 KB
実行使用メモリ 7,980 KB
最終ジャッジ日時 2023-09-09 05:45:12
合計ジャッジ時間 7,864 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,880 KB
testcase_01 AC 16 ms
7,816 KB
testcase_02 AC 15 ms
7,788 KB
testcase_03 AC 15 ms
7,824 KB
testcase_04 AC 351 ms
7,980 KB
testcase_05 AC 62 ms
7,932 KB
testcase_06 AC 16 ms
7,936 KB
testcase_07 AC 15 ms
7,892 KB
testcase_08 WA -
testcase_09 TLE -
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

firstdata = int(input());
tfir = 0;
tsec = 0;
tthir = 0;
tfour = 1;
result = 0;
siteik = 0;

for inp in range(0,firstdata):
	siteik = int(input());
	if siteik < 4:
		print(0);
	elif siteik == 4:
		print(1);
	else:
		for inp2 in range(5,siteik+1):
			result = (tfir + tsec + tthir + tfour)%17;
			tfir = tsec;
			tsec = tthir;
			tthir = tfour;
			tfour = result;
		print(result);
0