結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー DexctersuDexctersu
提出日時 2018-01-10 00:18:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,219 ms / 2,000 ms
コード長 162 bytes
コンパイル時間 581 ms
コンパイル使用メモリ 10,560 KB
実行使用メモリ 204,012 KB
最終ジャッジ日時 2023-08-25 02:29:08
合計ジャッジ時間 5,449 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,800 KB
testcase_01 AC 15 ms
7,824 KB
testcase_02 AC 15 ms
7,960 KB
testcase_03 AC 15 ms
7,816 KB
testcase_04 AC 19 ms
7,856 KB
testcase_05 AC 15 ms
7,820 KB
testcase_06 AC 15 ms
7,840 KB
testcase_07 AC 15 ms
7,876 KB
testcase_08 AC 16 ms
8,312 KB
testcase_09 AC 34 ms
11,956 KB
testcase_10 AC 190 ms
47,096 KB
testcase_11 AC 1,154 ms
203,956 KB
testcase_12 AC 607 ms
47,168 KB
testcase_13 AC 1,219 ms
204,012 KB
testcase_14 AC 1,095 ms
203,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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