結果
| 問題 |
No.657 テトラナッチ数列 Easy
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-31 16:46:46 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 888 bytes |
| コンパイル時間 | 1,000 ms |
| コンパイル使用メモリ | 105,344 KB |
| 実行使用メモリ | 22,912 KB |
| 最終ジャッジ日時 | 2025-01-03 04:40:48 |
| 合計ジャッジ時間 | 2,538 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 RE * 1 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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]);
}
}
}
}