結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー _KingdomOfMoray_KingdomOfMoray
提出日時 2020-01-06 19:12:15
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 216 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 21,376 KB
最終ジャッジ日時 2024-11-23 00:05:59
合計ジャッジ時間 16,294 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7 TLE * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

input_list = list(map(int,input().split()))
n, m = input_list

front2 = 0
front1 = 1
cur = None

for i in range(3, n + 1):
    cur = front2 + front1
    front2 = front1
    front1 = cur
    
res = cur % m

print(res)
0