結果

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

open System
type Sol() =
    member this.Solve() = 
        let N = stdin.ReadLine() |> int
        let A = stdin.ReadLine().Split(' ') |> Array.map int |> Array.sort 
        let pairA = Seq.pairwise A |> Seq.map (fun (x,y) -> (y - x)) |> Seq.distinct
        let yesno = ((Seq.distinct A |> Seq.length) = N) && (Seq.length pairA) = 1
        if yesno = true then Console.WriteLine("YES") else Console.WriteLine("NO") 

let mySol = new Sol()
mySol.Solve()
0