結果

問題 No.64 XORフィボナッチ数列
ユーザー はむ吉🐹はむ吉🐹
提出日時 2015-10-22 00:37:20
言語 Haskell
(9.8.2)
結果
TLE  
実行時間 -
コード長 383 bytes
コンパイル時間 783 ms
コンパイル使用メモリ 164,648 KB
実行使用メモリ 15,288 KB
最終ジャッジ日時 2023-09-29 17:22:09
合計ジャッジ時間 7,548 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,132 KB
testcase_01 AC 2 ms
7,232 KB
testcase_02 AC 3 ms
7,144 KB
testcase_03 AC 3 ms
7,120 KB
testcase_04 AC 2 ms
7,164 KB
testcase_05 AC 2 ms
7,148 KB
testcase_06 AC 3 ms
7,228 KB
testcase_07 AC 2 ms
7,168 KB
testcase_08 AC 3 ms
7,132 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

ソースコード

diff #

import Data.Bits (xor, Bits)
import Control.Applicative ((<$>))

xorFibonacci :: (Bits a, Integral a) => a -> a -> [a]
xorFibonacci a1 a2 = seq a1 $ (:) a1 $ xorFibonacci a2 $ xor a1 a2

main :: IO ()
main = do
    (f0 : f1 : n : _) <- words <$> getLine
    let [f0', f1'] = map read [f0, f1] :: [Integer]
    let n' = read n :: Int
    print $ head $ drop n' $ xorFibonacci f0' f1'
0