結果

問題 No.786 京都大学の過去問
ユーザー kekuremakekurema
提出日時 2019-03-18 16:38:10
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 544 bytes
コンパイル時間 2,041 ms
コンパイル使用メモリ 101,220 KB
実行使用メモリ 22,712 KB
最終ジャッジ日時 2023-09-25 14:14:52
合計ジャッジ時間 3,014 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
22,640 KB
testcase_01 AC 54 ms
20,588 KB
testcase_02 AC 53 ms
20,872 KB
testcase_03 WA -
testcase_04 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace contest
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());

            int[] array = new int[50];

            array[0] = 1;
            array[1] = 2;

            for (int i = 2; i < N; i++)
            {
                array[i] = array[i - 2] + array[i - 1]; 
            }

            Console.WriteLine(array[N - 1]);
        }
    }
}
0