結果

問題 No.44 DPなすごろく
ユーザー suzusuzu
提出日時 2023-05-01 11:49:02
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 22 ms / 5,000 ms
コード長 392 bytes
コンパイル時間 1,936 ms
コンパイル使用メモリ 111,988 KB
実行使用メモリ 25,924 KB
最終ジャッジ日時 2024-04-30 15:26:49
合計ジャッジ時間 3,237 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
25,800 KB
testcase_01 AC 20 ms
23,764 KB
testcase_02 AC 20 ms
25,800 KB
testcase_03 AC 19 ms
23,764 KB
testcase_04 AC 19 ms
23,888 KB
testcase_05 AC 20 ms
23,604 KB
testcase_06 AC 21 ms
25,804 KB
testcase_07 AC 19 ms
25,420 KB
testcase_08 AC 19 ms
25,920 KB
testcase_09 AC 20 ms
23,512 KB
testcase_10 AC 20 ms
23,768 KB
testcase_11 AC 20 ms
25,668 KB
testcase_12 AC 22 ms
25,804 KB
testcase_13 AC 20 ms
23,512 KB
testcase_14 AC 20 ms
23,876 KB
testcase_15 AC 19 ms
25,800 KB
testcase_16 AC 20 ms
25,924 KB
testcase_17 AC 20 ms
23,728 KB
testcase_18 AC 20 ms
25,540 KB
testcase_19 AC 19 ms
21,560 KB
testcase_20 AC 19 ms
23,748 KB
testcase_21 AC 19 ms
23,772 KB
testcase_22 AC 19 ms
25,812 KB
testcase_23 AC 19 ms
23,644 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.Linq;
using System.Collections.Generic;
class Program
{
    static void Main(string[] args)
    {
    	long N = long.Parse(Console.ReadLine());
    	var array = new long[N + 1];
    	
    	array[0] = 1;
    	array[1] = 1;
    		
    	for(long i = 2;i < N + 1;i++)
    	{
    		array[i] = array[i - 1] + array[i - 2];
    	}
    	Console.WriteLine(array[N]);
    }
}
0