結果

問題 No.786 京都大学の過去問
ユーザー kekuremakekurema
提出日時 2019-03-18 16:31:02
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 480 bytes
コンパイル時間 1,949 ms
コンパイル使用メモリ 99,568 KB
実行使用メモリ 25,088 KB
最終ジャッジ日時 2023-09-25 14:01:31
合計ジャッジ時間 5,618 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
25,088 KB
testcase_01 AC 55 ms
20,888 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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());
            Console.WriteLine(f(N));
        }

        static public int f(int N)
        {
            if (N == 1) return 1;
            if (N == 2) return 2;
            return f(N - 2) + f(N - 1);
        }
    }
}
0