結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー Maple_LandscapeMaple_Landscape
提出日時 2017-06-09 23:40:32
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,807 ms / 2,000 ms
コード長 84 bytes
コンパイル時間 430 ms
コンパイル使用メモリ 11,900 KB
実行使用メモリ 35,080 KB
最終ジャッジ日時 2023-10-24 02:27:59
合計ジャッジ時間 10,072 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
16,724 KB
testcase_01 AC 102 ms
16,724 KB
testcase_02 AC 106 ms
16,728 KB
testcase_03 AC 102 ms
16,728 KB
testcase_04 AC 104 ms
16,724 KB
testcase_05 AC 102 ms
16,724 KB
testcase_06 AC 103 ms
16,724 KB
testcase_07 AC 104 ms
16,724 KB
testcase_08 AC 104 ms
16,724 KB
testcase_09 AC 110 ms
16,724 KB
testcase_10 AC 273 ms
20,080 KB
testcase_11 AC 1,797 ms
35,080 KB
testcase_12 AC 1,802 ms
35,080 KB
testcase_13 AC 1,804 ms
35,080 KB
testcase_14 AC 1,807 ms
35,080 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'matrix'
N,M=gets.split.map(&:to_i)
puts (Matrix[[1,1],[1,0]]**(N-2))[0,0]%M
0