結果

問題 No.406 鴨等間隔の法則
ユーザー tak
提出日時 2018-04-13 15:19:09
言語 F#
(F# 4.0)
結果
AC  
実行時間 105 ms / 2,000 ms
コード長 345 bytes
コンパイル時間 11,327 ms
コンパイル使用メモリ 185,732 KB
実行使用メモリ 47,744 KB
最終ジャッジ日時 2024-07-07 12:23:01
合計ジャッジ時間 10,578 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (245 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 #

stdin.ReadLine() |> ignore
stdin.ReadLine().Split() 
|> Array.map(int)
|> Array.sort
|> Array.pairwise
|> Array.map(fun (a,b) -> b-a)
|> function 
    | x when x |> Array.forall (fun x -> x<>0) -> 
        x
        |> Array.distinct
        |> Array.length
        |> function | 1 -> "YES" | _ -> "NO"
    | _ -> "NO"       
|> printfn "%s"    
0