結果

問題 No.657 テトラナッチ数列 Easy
ユーザー bluemeganebluemegane
提出日時 2018-09-08 09:34:56
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 536 bytes
コンパイル時間 3,776 ms
コンパイル使用メモリ 101,400 KB
実行使用メモリ 26,112 KB
最終ジャッジ日時 2023-08-21 18:07:13
合計ジャッジ時間 6,429 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
25,996 KB
testcase_01 AC 72 ms
22,056 KB
testcase_02 AC 72 ms
26,096 KB
testcase_03 AC 70 ms
22,068 KB
testcase_04 AC 71 ms
24,000 KB
testcase_05 AC 116 ms
25,944 KB
testcase_06 AC 71 ms
24,168 KB
testcase_07 AC 71 ms
26,000 KB
testcase_08 AC 71 ms
23,952 KB
testcase_09 AC 117 ms
24,044 KB
testcase_10 AC 118 ms
26,012 KB
testcase_11 AC 120 ms
26,112 KB
testcase_12 AC 119 ms
23,984 KB
testcase_13 AC 119 ms
26,108 KB
testcase_14 AC 119 ms
24,024 KB
testcase_15 AC 119 ms
25,920 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

public class Hello
{
    public static void Main()
    {
        var a = new int[1000001];
        a[4] = 1; a[5] = 1;
        tetraset(a);
        var q = int.Parse(Console.ReadLine().Trim());
        for (int i = 0; i < q; i++)
        {
            var n = int.Parse(Console.ReadLine().Trim());
            Console.WriteLine(a[n]);
        }
    }
    public static void tetraset ( int[] a )
    {
        for (int i = 6; i <= 1000000; i++)
            a[i] = (a[i - 1] + a[i - 2] + a[i - 3] + a[i - 4]) % 17;
    }
}
0