結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー Akisawa3Akisawa3
提出日時 2023-04-22 22:49:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 174 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 21,632 KB
最終ジャッジ日時 2024-04-25 00:38:29
合計ジャッジ時間 4,147 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

N, M = map(int, input().split())

def fib(n):
    a = 0
    b = 1
    for _ in range(n-2):
        c = b
        b += a
        a = c
    return a 
        
print(fib(N) % M)
0