結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー gimgim
提出日時 2017-06-20 16:14:38
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 192 bytes
コンパイル時間 366 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 13,760 KB
最終ジャッジ日時 2024-04-10 04:29:46
合計ジャッジ時間 4,478 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
13,760 KB
testcase_01 AC 12 ms
6,944 KB
testcase_02 AC 221 ms
6,940 KB
testcase_03 AC 10 ms
6,940 KB
testcase_04 AC 593 ms
6,944 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n=raw_input()
N=map(int, n.split())

def fibo(num):
    if num==0:
        return 0
    elif num==1:
        return 1
    else:
        return fibo(num-2)+fibo(num-1)

print fibo(N[0]-1)%N[1]
0