結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー 👑 hos.lyrichos.lyric
提出日時 2020-04-01 09:14:20
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,018 ms / 2,000 ms
コード長 77 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 11,352 KB
実行使用メモリ 15,424 KB
最終ジャッジ日時 2023-09-08 11:18:56
合計ジャッジ時間 6,201 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,264 KB
testcase_01 AC 79 ms
15,076 KB
testcase_02 AC 78 ms
15,148 KB
testcase_03 AC 85 ms
15,036 KB
testcase_04 AC 78 ms
15,300 KB
testcase_05 AC 79 ms
15,120 KB
testcase_06 AC 78 ms
15,176 KB
testcase_07 AC 79 ms
15,120 KB
testcase_08 AC 87 ms
15,340 KB
testcase_09 AC 99 ms
15,268 KB
testcase_10 AC 267 ms
15,292 KB
testcase_11 AC 1,013 ms
15,272 KB
testcase_12 AC 1,010 ms
15,420 KB
testcase_13 AC 1,013 ms
15,424 KB
testcase_14 AC 1,018 ms
15,344 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,m=gets.split.map &:to_i
p (2..n).inject([0,1]){|a|[a[1],(a[0]+a[1])%m]}[0]
0