結果

問題 No.954 Result
ユーザー ikdikd
提出日時 2020-06-07 16:12:39
言語 F#
(F# 4.0)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 587 bytes
コンパイル時間 4,572 ms
コンパイル使用メモリ 164,144 KB
実行使用メモリ 29,288 KB
最終ジャッジ日時 2023-09-17 18:14:49
合計ジャッジ時間 10,247 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
29,228 KB
testcase_01 AC 118 ms
29,232 KB
testcase_02 AC 118 ms
27,276 KB
testcase_03 AC 117 ms
25,104 KB
testcase_04 AC 115 ms
27,176 KB
testcase_05 AC 119 ms
27,104 KB
testcase_06 AC 118 ms
29,152 KB
testcase_07 AC 118 ms
24,960 KB
testcase_08 AC 117 ms
27,204 KB
testcase_09 AC 118 ms
27,216 KB
testcase_10 AC 117 ms
27,076 KB
testcase_11 AC 117 ms
27,292 KB
testcase_12 AC 120 ms
27,172 KB
testcase_13 AC 118 ms
29,172 KB
testcase_14 AC 118 ms
27,052 KB
testcase_15 AC 120 ms
29,212 KB
testcase_16 AC 117 ms
27,188 KB
testcase_17 AC 118 ms
27,220 KB
testcase_18 AC 118 ms
29,288 KB
testcase_19 AC 119 ms
27,124 KB
testcase_20 AC 117 ms
27,212 KB
testcase_21 AC 117 ms
27,156 KB
testcase_22 AC 118 ms
27,056 KB
testcase_23 AC 118 ms
27,060 KB
testcase_24 AC 118 ms
27,184 KB
testcase_25 AC 119 ms
27,072 KB
testcase_26 AC 119 ms
29,096 KB
testcase_27 AC 119 ms
27,312 KB
testcase_28 AC 117 ms
27,112 KB
testcase_29 AC 119 ms
27,076 KB
testcase_30 AC 118 ms
27,236 KB
testcase_31 AC 119 ms
29,172 KB
testcase_32 AC 118 ms
29,168 KB
testcase_33 AC 119 ms
29,264 KB
testcase_34 AC 117 ms
27,120 KB
testcase_35 AC 119 ms
25,064 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

open System


[<EntryPoint>]
let main _ =
    let a =
        [|for _ in 1 .. 5 -> stdin.ReadLine() |> int64|]
        |> Array.rev

    let fib =
        (1L,1L)
        |> Seq.unfold(fun (f1,f2) ->
            if f1 > 1000000000000000L then None else Some(f1,(f2,f1 + f2)))
        |> Seq.toArray

    let ans =
        [for n in 1 .. 5 -> n]
        |> List.filter(fun n ->
            let b = a |> Array.take n
            [for i in 0 .. fib.Length - n -> Array.sub fib i n]
            |> List.exists((=) b))

    printfn "%d" <| if ans.Length = 0 then 0 else ans |> List.max
    0
0