結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー PNJPNJ
提出日時 2023-06-03 15:39:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 119 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 10,504 KB
実行使用メモリ 205,640 KB
最終ジャッジ日時 2023-08-28 07:57:12
合計ジャッジ時間 9,908 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,752 KB
testcase_01 AC 15 ms
7,828 KB
testcase_02 AC 15 ms
7,752 KB
testcase_03 AC 15 ms
7,784 KB
testcase_04 AC 15 ms
7,756 KB
testcase_05 AC 15 ms
7,736 KB
testcase_06 AC 15 ms
7,796 KB
testcase_07 AC 16 ms
7,736 KB
testcase_08 AC 19 ms
8,180 KB
testcase_09 AC 54 ms
12,112 KB
testcase_10 AC 393 ms
47,204 KB
testcase_11 TLE -
testcase_12 AC 1,627 ms
48,460 KB
testcase_13 TLE -
testcase_14 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
F = [0,0,1]
for i in range(3,N+1):
	f = (F[i-1] + F[i-2]) % M
	F.append(f)
	
print(F[N])
0