結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー tookunn_1213tookunn_1213
提出日時 2017-06-09 23:06:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 89 bytes
コンパイル時間 229 ms
コンパイル使用メモリ 81,832 KB
実行使用メモリ 57,352 KB
最終ジャッジ日時 2023-10-24 00:23:47
合計ジャッジ時間 1,666 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,464 KB
testcase_01 AC 36 ms
53,464 KB
testcase_02 AC 37 ms
53,464 KB
testcase_03 AC 36 ms
53,464 KB
testcase_04 AC 36 ms
53,464 KB
testcase_05 AC 36 ms
53,464 KB
testcase_06 AC 35 ms
53,464 KB
testcase_07 AC 37 ms
53,464 KB
testcase_08 AC 39 ms
57,352 KB
testcase_09 AC 40 ms
57,352 KB
testcase_10 AC 45 ms
57,352 KB
testcase_11 AC 69 ms
57,352 KB
testcase_12 AC 52 ms
57,288 KB
testcase_13 AC 70 ms
57,352 KB
testcase_14 AC 52 ms
57,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
a,b = 0,1
for i in range(N-2):
	a,b = b,(a+b)%M
print(b%M)
0