結果
問題 | No.64 XORフィボナッチ数列 |
ユーザー | karrym_ |
提出日時 | 2014-11-18 23:08:53 |
言語 | Haskell (9.8.2) |
結果 |
TLE
|
実行時間 | - |
コード長 | 359 bytes |
コンパイル時間 | 9,619 ms |
コンパイル使用メモリ | 163,248 KB |
実行使用メモリ | 7,320 KB |
最終ジャッジ日時 | 2023-08-30 20:58:17 |
合計ジャッジ時間 | 17,711 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
7,072 KB |
testcase_01 | AC | 2 ms
7,032 KB |
testcase_02 | AC | 3 ms
7,320 KB |
testcase_03 | AC | 2 ms
7,068 KB |
testcase_04 | AC | 2 ms
7,136 KB |
testcase_05 | AC | 3 ms
7,080 KB |
testcase_06 | AC | 2 ms
7,056 KB |
testcase_07 | AC | 2 ms
7,168 KB |
testcase_08 | AC | 2 ms
7,152 KB |
testcase_09 | TLE | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
import Data.Bits zipWith' :: (a -> b -> c) -> [a] -> [b] -> [c] zipWith' f (x:xs) (y:ys) = let z = f x y in z `seq` z : zipWith' f xs ys zipWith' _ _ _ = [] fib :: Int -> Int -> [Int] fib a b = a : b : zipWith' xor xs (tail xs) where xs = fib a b main = do [a, b, n] <- fmap (map read . words) getLine print $ fib a b !! n