結果

問題 No.657 テトラナッチ数列 Easy
ユーザー taktak
提出日時 2018-03-18 01:50:17
言語 F#
(F# 4.0)
結果
AC  
実行時間 258 ms / 2,000 ms
コード長 329 bytes
コンパイル時間 3,234 ms
コンパイル使用メモリ 162,504 KB
実行使用メモリ 40,876 KB
最終ジャッジ日時 2023-08-25 19:19:09
合計ジャッジ時間 7,945 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 204 ms
38,616 KB
testcase_01 AC 204 ms
38,644 KB
testcase_02 AC 203 ms
38,692 KB
testcase_03 AC 204 ms
40,692 KB
testcase_04 AC 204 ms
40,628 KB
testcase_05 AC 252 ms
40,740 KB
testcase_06 AC 202 ms
36,548 KB
testcase_07 AC 204 ms
38,764 KB
testcase_08 AC 202 ms
38,564 KB
testcase_09 AC 256 ms
40,728 KB
testcase_10 AC 254 ms
40,744 KB
testcase_11 AC 253 ms
40,776 KB
testcase_12 AC 253 ms
40,876 KB
testcase_13 AC 258 ms
40,768 KB
testcase_14 AC 255 ms
40,704 KB
testcase_15 AC 253 ms
38,668 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

open System

let read() = Console.ReadLine() |> int

let tetra =
    let rec f a b c d =
        seq{
            yield a
            yield! f b c d ((a+b+c+d)%17)
        }
    f 0 0 0 1
    |> Seq.take(1000000+5)
    |> Seq.toArray

let Q = read()
Array.init Q (fun _ -> read())
|> Array.iter(fun x -> printfn "%i" tetra.[x-1])
0