結果
| 問題 | No.526 フィボナッチ数列の第N項をMで割った余りを求める |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-11-09 17:02:00 |
| 言語 | Kotlin (2.3.20) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 262 bytes |
| 記録 | |
| コンパイル時間 | 7,837 ms |
| コンパイル使用メモリ | 452,416 KB |
| 実行使用メモリ | 51,936 KB |
| 最終ジャッジ日時 | 2026-04-04 17:17:49 |
| 合計ジャッジ時間 | 11,467 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 12 |
ソースコード
import java.math.BigInteger
fun main(){println(fib(readLine()!!.toBigInteger())%readLine()!!.toBigInteger())}
tailrec fun fib(n:BigInteger,a:BigInteger=BigInteger.ZERO,b:BigInteger=BigInteger.ONE):BigInteger{return if(n==BigInteger.ONE)a else fib(n.dec(),b,a+b)}