結果

問題 No.658 テトラナッチ数列 Hard
ユーザー iwkjoseciwkjosec
提出日時 2018-04-14 03:18:45
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 422 bytes
コンパイル時間 2,135 ms
コンパイル使用メモリ 101,652 KB
実行使用メモリ 22,736 KB
最終ジャッジ日時 2023-09-09 04:59:31
合計ジャッジ時間 3,884 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
20,728 KB
testcase_01 AC 56 ms
20,768 KB
testcase_02 AC 56 ms
20,676 KB
testcase_03 AC 57 ms
20,820 KB
testcase_04 AC 99 ms
20,840 KB
testcase_05 AC 99 ms
18,864 KB
testcase_06 AC 102 ms
20,672 KB
testcase_07 AC 100 ms
22,732 KB
testcase_08 AC 100 ms
22,736 KB
testcase_09 AC 101 ms
20,740 KB
testcase_10 AC 98 ms
20,788 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;

class Program
{
    static void Main()
    {
        var T = new int[4912];
        T[3] = 1;
        for (int i = 4; i < 4912; i++) T[i] = (T[i - 1] + T[i - 2] + T[i - 3] + T[i - 4]) % 17;
 
        var Q = int.Parse(ReadLine());
        for (int i = 0; i < Q; i++) WriteLine(T[(long.Parse(ReadLine()) - 1) % 4912]);
    }
}
0