結果
| 問題 |
No.954 Result
|
| コンテスト | |
| ユーザー |
ikd
|
| 提出日時 | 2020-06-07 16:12:39 |
| 言語 | F# (F# 4.0) |
| 結果 |
AC
|
| 実行時間 | 353 ms / 2,000 ms |
| コード長 | 587 bytes |
| コンパイル時間 | 9,206 ms |
| コンパイル使用メモリ | 195,136 KB |
| 実行使用メモリ | 36,072 KB |
| 最終ジャッジ日時 | 2024-07-04 12:47:36 |
| 合計ジャッジ時間 | 22,879 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 7 |
| other | AC * 29 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (562 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
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
ikd