結果
問題 |
No.526 フィボナッチ数列の第N項をMで割った余りを求める
|
ユーザー |
![]() |
提出日時 | 2017-07-21 11:10:15 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 274 bytes |
コンパイル時間 | 158 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 196,736 KB |
最終ジャッジ日時 | 2024-10-09 03:29:58 |
合計ジャッジ時間 | 4,808 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 8 TLE * 1 -- * 3 |
ソースコード
N,M=(int(i)for i in input(). split ()) F=[0] F.append(0) F.append(1) if N>3: i=3 while i<=N: # F[i-2]%=M # F[i-1]%=M # print (N) Fn=F[i-2]+F[i-1] # print (Fn) Fn%=M F.append(Fn) # print (F) i+=1 print (F[N])