結果
| 問題 | No.534 フィボナッチフィボナッチ数 |
| コンテスト | |
| ユーザー |
aimy
|
| 提出日時 | 2017-06-24 11:43:42 |
| 言語 | Haskell (9.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 380 bytes |
| 記録 | |
| コンパイル時間 | 2,852 ms |
| コンパイル使用メモリ | 193,792 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-20 01:12:42 |
| 合計ジャッジ時間 | 4,593 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 21 WA * 21 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.14.1/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
q = 10^9+7 :: Integer fib modulo n = fst (fibr (0,1) n) where tpq (p,q) (a,b) = (mod (p*a + q*b) modulo, mod (q*a + (p+q)*b) modulo) fibr pq@(p,q) n | n < 1 = (0,1) | even n = fibr (mod (p^2 + q^2) modulo, mod (2*p*q + q^2) modulo) (div n 2) | otherwise = tpq pq (fibr pq (n-1)) main = do n <- readLn :: IO Integer print $ fib q (fib q (mod n (2 * (10^9) + 16)))
aimy