結果

問題 No.954 Result
ユーザー guriceringuricerin
提出日時 2019-12-18 10:05:54
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 1,018 bytes
コンパイル時間 4,389 ms
コンパイル使用メモリ 165,720 KB
実行使用メモリ 28,276 KB
最終ジャッジ日時 2023-09-20 01:53:07
合計ジャッジ時間 9,925 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
24,248 KB
testcase_01 AC 83 ms
26,296 KB
testcase_02 AC 85 ms
24,360 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 83 ms
24,428 KB
testcase_08 AC 83 ms
24,304 KB
testcase_09 AC 83 ms
26,284 KB
testcase_10 AC 84 ms
24,356 KB
testcase_11 AC 83 ms
24,352 KB
testcase_12 AC 84 ms
26,292 KB
testcase_13 AC 84 ms
24,316 KB
testcase_14 AC 87 ms
24,304 KB
testcase_15 AC 83 ms
22,284 KB
testcase_16 AC 84 ms
26,372 KB
testcase_17 AC 86 ms
26,300 KB
testcase_18 AC 83 ms
24,424 KB
testcase_19 AC 84 ms
26,372 KB
testcase_20 AC 84 ms
24,332 KB
testcase_21 AC 86 ms
24,308 KB
testcase_22 AC 84 ms
24,328 KB
testcase_23 AC 84 ms
24,304 KB
testcase_24 AC 83 ms
24,428 KB
testcase_25 AC 82 ms
24,372 KB
testcase_26 AC 83 ms
24,380 KB
testcase_27 AC 84 ms
26,288 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 83 ms
24,324 KB
testcase_31 AC 83 ms
26,396 KB
testcase_32 AC 83 ms
24,352 KB
testcase_33 WA -
testcase_34 AC 84 ms
26,372 KB
testcase_35 AC 82 ms
24,244 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

open System
open System.Collections.Generic

[<AutoOpen>]
module Cin =
    let read f = stdin.ReadLine() |> f
    let reada f = stdin.ReadLine().Split() |> Array.map f

    let readInts() =
        read string
        |> Seq.toArray
        |> Array.map (fun x -> Convert.ToInt32(x.ToString()))

module Util =
    let strRev s =
        s
        |> Seq.rev
        |> Seq.map string
        |> String.concat ""

[<EntryPoint>]
let main _ =
    let A = Array.zeroCreate 5
    for i in 0 .. 4 do
        A.[i] <- read int64

    let mutable fib = new SortedSet<int64>()
    let mutable a = 0L
    let mutable b = 1L
    while a <= int64 1e15 do
        fib.Add(a) |> ignore
        fib.Add(b) |> ignore
        a <- a + b
        b <- b + a

    let mutable ans = 0
    if fib.Contains(A.[4]) then ans <- 1
    for i in 4 .. -1 .. 1 do
        let a = A.[i]
        let b = A.[i - 1]
        if a <= b && fib.Contains(a) && fib.Contains(b) then ans <- ans + 1

    printfn "%d" ans
    0 // return an integer exit code
0