結果
問題 |
No.657 テトラナッチ数列 Easy
|
ユーザー |
|
提出日時 | 2023-08-31 16:44:16 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 736 bytes |
コンパイル時間 | 2,765 ms |
コンパイル使用メモリ | 104,576 KB |
実行使用メモリ | 22,912 KB |
最終ジャッジ日時 | 2025-01-03 04:40:41 |
合計ジャッジ時間 | 4,406 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 RE * 4 |
コンパイルメッセージ
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]; 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]); } } } }