結果
問題 |
No.44 DPなすごろく
|
ユーザー |
|
提出日時 | 2023-07-25 11:48:24 |
言語 | C# (.NET 8.0.404) |
結果 |
AC
|
実行時間 | 54 ms / 5,000 ms |
コード長 | 530 bytes |
コンパイル時間 | 11,634 ms |
コンパイル使用メモリ | 167,440 KB |
実行使用メモリ | 182,772 KB |
最終ジャッジ日時 | 2024-10-02 06:09:31 |
合計ジャッジ時間 | 12,433 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (112 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
using System; using System.Collections.Generic; using System.Linq; namespace yukicoder { public class Program { public static void Main() { var n = int.Parse(Console.ReadLine()); var a = new long[n]; a[0] = 1; a[1] = 2; if (n > 2) { for(var i = 2; i < n; i++) { a[i] = a[i - 1] + a[i - 2]; } } Console.WriteLine(a[n - 1]); } } }