結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー yutakahanyutakahan
提出日時 2017-09-14 11:04:09
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 453 bytes
コンパイル時間 3,104 ms
コンパイル使用メモリ 102,912 KB
実行使用メモリ 23,296 KB
最終ジャッジ日時 2024-04-25 09:12:41
合計ジャッジ時間 6,703 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
23,296 KB
testcase_01 AC 21 ms
18,048 KB
testcase_02 AC 26 ms
17,920 KB
testcase_03 AC 20 ms
17,792 KB
testcase_04 AC 32 ms
17,792 KB
testcase_05 AC 962 ms
17,536 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
public class Hello{
    static long fivo(long n){
        if(n == 1){
            return 0;
        }else if(n == 2){
            return 1;
        }else{
            return fivo(n - 2) + fivo(n - 1);
        }
    }
    public static void Main(){
        string[] input = Console.ReadLine().Split(' ');
        long N = long.Parse(input[0]);
        long M = long.Parse(input[1]);
        Console.WriteLine(fivo(N) % M);
        
    }
}
0