結果

問題 No.64 XORフィボナッチ数列
ユーザー momen999momen999
提出日時 2017-06-05 21:00:20
言語 Haskell
(9.8.2)
結果
TLE  
実行時間 -
コード長 287 bytes
コンパイル時間 3,588 ms
コンパイル使用メモリ 162,456 KB
実行使用メモリ 5,340 KB
最終ジャッジ日時 2023-10-22 05:36:33
合計ジャッジ時間 8,793 ms
ジャッジサーバーID
(参考情報)
judge11 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,324 KB
testcase_01 AC 2 ms
5,320 KB
testcase_02 AC 3 ms
5,324 KB
testcase_03 AC 3 ms
5,332 KB
testcase_04 AC 2 ms
5,332 KB
testcase_05 AC 2 ms
5,340 KB
testcase_06 AC 2 ms
5,340 KB
testcase_07 AC 2 ms
5,340 KB
testcase_08 AC 2 ms
5,340 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

import Data.Bits

fact :: [Integer] -> Integer
fact [f0, f1, n]
    | n == 0    = f0
    | n == 1    = f1
    | otherwise = f f1 f0 (n - 2)
    where
    f a b i | i == 0    = a `xor` b
            | otherwise = f (a `xor` b) a (i - 1)

main = getLine >>= print . fact . map read . words
0