結果
| 問題 | No.526 フィボナッチ数列の第N項をMで割った余りを求める |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-05-08 14:22:07 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 166 bytes |
| 記録 | |
| コンパイル時間 | 614 ms |
| コンパイル使用メモリ | 20,864 KB |
| 実行使用メモリ | 54,300 KB |
| 最終ジャッジ日時 | 2026-05-08 14:22:18 |
| 合計ジャッジ時間 | 9,027 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 12 |
ソースコード
N, M = map(int, input().split()) i = 1 s = [0] * N s[1] = 1 if N <= 2: print (N-1) else: while i <= N-1: s[i] = s[i - 1] +s[i - 2] i += 1 print(s[N-1] % M)