結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー first_vil
提出日時 2020-08-06 11:59:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 109 bytes
コンパイル時間 682 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 96,640 KB
最終ジャッジ日時 2024-09-19 12:17:51
合計ジャッジ時間 2,229 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
a=[0]*(n+1)
a[2]=1
for i in range(3,n+1):
    a[i]=(a[i-2]+a[i-1])%m
print(a[n])
0