結果

問題 No.44 DPなすごろく
ユーザー mbanmban
提出日時 2016-09-18 02:40:19
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 24 ms / 5,000 ms
コード長 482 bytes
コンパイル時間 1,050 ms
コンパイル使用メモリ 107,576 KB
実行使用メモリ 25,784 KB
最終ジャッジ日時 2024-04-28 15:23:59
合計ジャッジ時間 2,561 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
23,396 KB
testcase_01 AC 24 ms
23,884 KB
testcase_02 AC 23 ms
23,768 KB
testcase_03 AC 23 ms
23,520 KB
testcase_04 AC 24 ms
25,664 KB
testcase_05 AC 23 ms
25,536 KB
testcase_06 AC 23 ms
23,264 KB
testcase_07 AC 24 ms
21,556 KB
testcase_08 AC 22 ms
23,496 KB
testcase_09 AC 23 ms
23,640 KB
testcase_10 AC 23 ms
25,692 KB
testcase_11 AC 23 ms
25,784 KB
testcase_12 AC 22 ms
21,560 KB
testcase_13 AC 23 ms
23,520 KB
testcase_14 AC 24 ms
23,616 KB
testcase_15 AC 23 ms
23,732 KB
testcase_16 AC 23 ms
21,300 KB
testcase_17 AC 23 ms
23,392 KB
testcase_18 AC 23 ms
23,516 KB
testcase_19 AC 23 ms
23,644 KB
testcase_20 AC 23 ms
23,516 KB
testcase_21 AC 23 ms
25,660 KB
testcase_22 AC 23 ms
23,644 KB
testcase_23 AC 23 ms
25,664 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;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;


class Magatoro {
    
    static void Main() {
        int N = int.Parse(Console.ReadLine());
        long[] A = new long[N+1];
        A[0] = 1;
        A[1] = 1;
        for(int i = 2; i <= N; i++) {
            A[i] = A[i - 1] + A[i - 2];
        }
        Console.WriteLine(A[N]);
    }
}
0