結果

問題 No.406 鴨等間隔の法則
コンテスト
ユーザー kuuso1
提出日時 2016-08-16 08:09:09
言語 F#
(F# 10.0)
コンパイル:
fsharp_c _filename_
実行:
/usr/bin/dotnet_wrap
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 457 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 14,043 ms
コンパイル使用メモリ 198,936 KB
実行使用メモリ 52,864 KB
最終ジャッジ日時 2026-03-29 02:01:30
合計ジャッジ時間 16,918 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (203 ミリ秒)。
  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

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