結果

問題 No.64 XORフィボナッチ数列
ユーザー taktak
提出日時 2019-02-10 17:54:49
言語 F#
(F# 4.0)
結果
AC  
実行時間 84 ms / 5,000 ms
コード長 291 bytes
コンパイル時間 3,134 ms
コンパイル使用メモリ 158,500 KB
実行使用メモリ 24,952 KB
最終ジャッジ日時 2023-09-20 19:38:54
合計ジャッジ時間 5,128 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
22,884 KB
testcase_01 AC 83 ms
22,832 KB
testcase_02 AC 82 ms
22,788 KB
testcase_03 AC 82 ms
22,752 KB
testcase_04 AC 84 ms
22,880 KB
testcase_05 AC 84 ms
22,848 KB
testcase_06 AC 83 ms
22,764 KB
testcase_07 AC 83 ms
22,868 KB
testcase_08 AC 83 ms
20,820 KB
testcase_09 AC 82 ms
22,812 KB
testcase_10 AC 82 ms
20,864 KB
testcase_11 AC 82 ms
22,892 KB
testcase_12 AC 82 ms
24,952 KB
testcase_13 AC 82 ms
22,868 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

let xorFib n f0 f1 =
  let rec f n ``f_n-2`` ``f_n-1`` =
    match n with
    | 0L -> ``f_n-2``
    | _ -> f (n-1L) ``f_n-1`` (``f_n-2``^^^``f_n-1``)
  f n f0 f1

let f0, f1, n =
  let t = stdin.ReadLine().Split() |> Array.map int64
  t.[0], t.[1], t.[2]

xorFib (n%3L) f0 f1
|> printfn "%i"
0