結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー WatsonWatson
提出日時 2017-07-27 11:20:06
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 141 bytes
コンパイル時間 218 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 17,956 KB
最終ジャッジ日時 2024-10-10 02:03:51
合計ジャッジ時間 4,336 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7 TLE * 1 -- * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = [int(i) for i in input().split()]
N1 = 0
N2 = 1
Nans = 0
for i in range(N-2):
    Nans = N1+N2
    N1 = N2
    N2 = Nans
print(Nans%M)
0