結果

問題 No.657 テトラナッチ数列 Easy
ユーザー 抹茶アイス抹茶アイス
提出日時 2023-08-31 16:44:16
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 736 bytes
コンパイル時間 2,514 ms
コンパイル使用メモリ 102,428 KB
実行使用メモリ 26,752 KB
最終ジャッジ日時 2023-08-31 16:44:22
合計ジャッジ時間 5,286 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 AC 56 ms
21,448 KB
testcase_04 AC 70 ms
24,376 KB
testcase_05 RE -
testcase_06 AC 57 ms
21,436 KB
testcase_07 AC 56 ms
21,428 KB
testcase_08 AC 73 ms
26,752 KB
testcase_09 AC 101 ms
21,612 KB
testcase_10 AC 98 ms
21,476 KB
testcase_11 AC 100 ms
21,448 KB
testcase_12 AC 100 ms
19,336 KB
testcase_13 AC 115 ms
24,868 KB
testcase_14 AC 122 ms
24,804 KB
testcase_15 AC 116 ms
24,760 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 System.Numerics;

namespace yukicoder
{
    public class Program
    {
        public static void Main()
        {
            var q = int.Parse(Console.ReadLine());
            var n = new int[q];
            for(var i = 0; i < q; i++)
            {
                n[i] = int.Parse(Console.ReadLine());
            }
            var m = n.Max();
            var a = new int[m];
            a[3] = 1;
            for(var i = 4; i < m; i++)
            {
                a[i] = (a[i - 1] + a[i - 2] + a[i - 3] + a[i - 4]) % 17;
            }
            foreach(var i in n)
            {
                Console.WriteLine(a[i-1]);
            }
        }
    }
}
0