結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
21,512 KB
testcase_01 AC 57 ms
23,468 KB
testcase_02 RE -
testcase_03 AC 56 ms
21,544 KB
testcase_04 AC 70 ms
24,484 KB
testcase_05 AC 96 ms
21,380 KB
testcase_06 AC 57 ms
21,308 KB
testcase_07 AC 56 ms
19,428 KB
testcase_08 AC 72 ms
24,792 KB
testcase_09 AC 96 ms
21,376 KB
testcase_10 AC 99 ms
21,456 KB
testcase_11 AC 98 ms
19,424 KB
testcase_12 AC 99 ms
21,500 KB
testcase_13 AC 114 ms
24,728 KB
testcase_14 AC 114 ms
24,792 KB
testcase_15 AC 114 ms
24,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 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];
            if (m >= 3)
            {
                a[3] = 1;
                if(m >= 4)
                {
                    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