結果

問題 No.406 鴨等間隔の法則
ユーザー ichibanshibori
提出日時 2016-08-06 18:06:42
言語 F#
(F# 4.0)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 371 bytes
コンパイル時間 14,614 ms
コンパイル使用メモリ 188,248 KB
実行使用メモリ 53,120 KB
最終ジャッジ日時 2024-07-07 11:31:18
合計ジャッジ時間 19,483 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (303 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/

ソースコード

diff #

let doIt () =
    let _ = stdin.ReadLine ()
    let xlist = stdin.ReadLine () |> fun s -> s.Split () |> Seq.map int |> Seq.sort
    let dlist = xlist |> Seq.pairwise |> Seq.map (fun (x1, x2) -> x2 - x1) |> Seq.cache
    let d1 = Seq.head dlist

    (d1 > 0 && Seq.forall (fun d -> d = d1) dlist) |>
    (function | true -> "YES" | false -> "NO") |> printfn "%s"

doIt ()
0