結果

問題 No.406 鴨等間隔の法則
コンテスト
ユーザー ichibanshibori
提出日時 2016-08-06 18:06:42
言語 F#
(F# 10.0)
コンパイル:
fsharp_c _filename_
実行:
/usr/bin/dotnet_wrap
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 371 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 14,392 ms
コンパイル使用メモリ 204,976 KB
実行使用メモリ 55,296 KB
最終ジャッジ日時 2026-03-29 01:55:59
合計ジャッジ時間 12,139 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (173 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net10.0/main.dll
  main -> /home/judge/data/code/bin/Release/net10.0/publish/

ソースコード

diff #
raw source code

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