結果

問題 No.135 とりあえず1次元の問題
ユーザー はむ吉🐹はむ吉🐹
提出日時 2016-08-21 16:38:09
言語 F#
(F# 4.0)
結果
AC  
実行時間 340 ms / 5,000 ms
コード長 298 bytes
コンパイル時間 3,725 ms
コンパイル使用メモリ 157,152 KB
実行使用メモリ 46,636 KB
最終ジャッジ日時 2023-09-02 00:29:52
合計ジャッジ時間 8,200 ms
ジャッジサーバーID
(参考情報)
judge16 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 340 ms
44,848 KB
testcase_01 AC 94 ms
23,280 KB
testcase_02 AC 94 ms
23,276 KB
testcase_03 AC 88 ms
23,000 KB
testcase_04 AC 94 ms
25,184 KB
testcase_05 AC 93 ms
23,256 KB
testcase_06 AC 93 ms
21,208 KB
testcase_07 AC 93 ms
23,156 KB
testcase_08 AC 93 ms
23,348 KB
testcase_09 AC 94 ms
23,260 KB
testcase_10 AC 93 ms
25,220 KB
testcase_11 AC 93 ms
23,196 KB
testcase_12 AC 101 ms
23,452 KB
testcase_13 AC 93 ms
23,360 KB
testcase_14 AC 102 ms
23,572 KB
testcase_15 AC 101 ms
23,420 KB
testcase_16 AC 105 ms
23,464 KB
testcase_17 AC 102 ms
23,544 KB
testcase_18 AC 101 ms
23,500 KB
testcase_19 AC 104 ms
25,544 KB
testcase_20 AC 102 ms
23,540 KB
testcase_21 AC 154 ms
36,240 KB
testcase_22 AC 338 ms
46,636 KB
evil01.txt AC 295 ms
42,532 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

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