結果

問題 No.657 テトラナッチ数列 Easy
ユーザー arukukaarukuka
提出日時 2018-03-02 23:15:56
言語 D
(dmd 2.105.2)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 526 bytes
コンパイル時間 1,754 ms
コンパイル使用メモリ 89,312 KB
実行使用メモリ 11,860 KB
最終ジャッジ日時 2023-09-03 18:55:00
合計ジャッジ時間 2,561 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
10,764 KB
testcase_01 AC 59 ms
10,576 KB
testcase_02 AC 57 ms
10,804 KB
testcase_03 AC 58 ms
11,292 KB
testcase_04 AC 57 ms
11,032 KB
testcase_05 AC 63 ms
10,996 KB
testcase_06 AC 57 ms
11,044 KB
testcase_07 AC 58 ms
11,264 KB
testcase_08 AC 58 ms
11,780 KB
testcase_09 AC 62 ms
11,012 KB
testcase_10 AC 62 ms
11,288 KB
testcase_11 AC 62 ms
11,768 KB
testcase_12 AC 62 ms
11,580 KB
testcase_13 AC 63 ms
11,540 KB
testcase_14 AC 62 ms
11,236 KB
testcase_15 AC 62 ms
11,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.stdio;
import std.range;
import std.array;
import std.string;
import std.conv;
import std.typecons;
import std.algorithm;
import std.container;
import std.typecons;
import std.random;
import core.time;

auto t()
{
	int[] arr = [0, 0, 0, 1];
	foreach (i; 4..10^^6 + 1) {
		int v = 0;
		foreach (j; 0..4) {
			v += arr[i - j - 1];
			v %= 17;
		}
		arr ~= v;
	}
	return arr.idup;
}

void main()
{
	auto T = t;
	int q = readln.chomp.to!int;
	foreach (i; 0..q) {
		int n = readln.chomp.to!int - 1;
		T[n].writeln;
	}
}
0