結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,924 KB
testcase_01 AC 16 ms
7,836 KB
testcase_02 AC 16 ms
7,788 KB
testcase_03 AC 15 ms
7,840 KB
testcase_04 AC 350 ms
7,964 KB
testcase_05 AC 62 ms
7,952 KB
testcase_06 AC 16 ms
7,836 KB
testcase_07 AC 15 ms
7,800 KB
testcase_08 AC 404 ms
7,948 KB
testcase_09 AC 1,828 ms
7,956 KB
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);
		tfir = 0;
		tsec = 0;
		tthir = 0;
		tfour = 1;
0