結果
問題 | No.64 XORフィボナッチ数列 |
ユーザー | Michae'Gon |
提出日時 | 2015-04-22 17:21:36 |
言語 | Haskell (9.8.2) |
結果 |
TLE
|
実行時間 | - |
コード長 | 266 bytes |
コンパイル時間 | 5,386 ms |
コンパイル使用メモリ | 157,668 KB |
実行使用メモリ | 9,856 KB |
最終ジャッジ日時 | 2023-09-18 08:15:13 |
合計ジャッジ時間 | 11,470 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
7,116 KB |
testcase_01 | AC | 3 ms
7,132 KB |
testcase_02 | AC | 2 ms
7,052 KB |
testcase_03 | AC | 2 ms
7,064 KB |
testcase_04 | AC | 2 ms
7,064 KB |
testcase_05 | AC | 2 ms
7,200 KB |
testcase_06 | AC | 3 ms
7,196 KB |
testcase_07 | AC | 2 ms
7,064 KB |
testcase_08 | AC | 3 ms
7,128 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 import Data.Word main = getLine >>= print . solve . map read . words solve :: [Word64] -> Word64 solve [f0, f1, n] | n == 0 = f0 | n == 1 = f1 | otherwise = snd $ foldl (\(b2, b1) x -> (b1, xor b1 b2)) (f1, xor f0 f1) [3..n]