結果

問題 No.135 とりあえず1次元の問題
ユーザー はむ吉🐹
提出日時 2016-08-21 16:38:09
言語 F#
(F# 4.0)
結果
AC  
実行時間 541 ms / 5,000 ms
コード長 298 bytes
コンパイル時間 10,335 ms
コンパイル使用メモリ 194,172 KB
実行使用メモリ 78,284 KB
最終ジャッジ日時 2024-06-11 06:54:58
合計ジャッジ時間 17,118 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (774 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 computeMin xs =
    let ys = Set.ofSeq xs |> Set.toSeq
    if Seq.length ys < 2 then 0
    else Seq.pairwise ys |> Seq.map (fun (x, y) -> y - x |> abs) |> Seq.min

let () =
    let _ = stdin.ReadLine()
    let xs = stdin.ReadLine().Split(' ') |> Array.map int
    computeMin xs |> printfn "%d"
0