結果

問題 No.406 鴨等間隔の法則
ユーザー ichibanshiboriichibanshibori
提出日時 2016-08-06 18:06:42
言語 F#
(F# 4.0)
結果
AC  
実行時間 210 ms / 2,000 ms
コード長 371 bytes
コンパイル時間 5,132 ms
コンパイル使用メモリ 157,608 KB
実行使用メモリ 40,996 KB
最終ジャッジ日時 2023-09-21 17:54:48
合計ジャッジ時間 11,239 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
25,828 KB
testcase_01 AC 97 ms
23,084 KB
testcase_02 AC 97 ms
25,120 KB
testcase_03 AC 96 ms
23,196 KB
testcase_04 AC 173 ms
31,356 KB
testcase_05 AC 129 ms
25,584 KB
testcase_06 AC 132 ms
25,612 KB
testcase_07 AC 132 ms
27,776 KB
testcase_08 AC 173 ms
33,388 KB
testcase_09 AC 181 ms
33,744 KB
testcase_10 AC 135 ms
26,016 KB
testcase_11 AC 164 ms
30,800 KB
testcase_12 AC 142 ms
26,360 KB
testcase_13 AC 139 ms
26,324 KB
testcase_14 AC 192 ms
39,368 KB
testcase_15 AC 108 ms
23,852 KB
testcase_16 AC 109 ms
23,856 KB
testcase_17 AC 106 ms
23,544 KB
testcase_18 AC 110 ms
24,016 KB
testcase_19 AC 112 ms
24,256 KB
testcase_20 AC 116 ms
24,452 KB
testcase_21 AC 113 ms
24,236 KB
testcase_22 AC 126 ms
27,336 KB
testcase_23 AC 145 ms
28,456 KB
testcase_24 AC 184 ms
36,536 KB
testcase_25 AC 180 ms
33,780 KB
testcase_26 AC 210 ms
40,996 KB
testcase_27 AC 168 ms
31,748 KB
testcase_28 AC 175 ms
31,852 KB
testcase_29 AC 210 ms
39,080 KB
testcase_30 AC 205 ms
40,712 KB
testcase_31 AC 177 ms
31,504 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

let doIt () =
    let _ = stdin.ReadLine ()
    let xlist = stdin.ReadLine () |> fun s -> s.Split () |> Seq.map int |> Seq.sort
    let dlist = xlist |> Seq.pairwise |> Seq.map (fun (x1, x2) -> x2 - x1) |> Seq.cache
    let d1 = Seq.head dlist

    (d1 > 0 && Seq.forall (fun d -> d = d1) dlist) |>
    (function | true -> "YES" | false -> "NO") |> printfn "%s"

doIt ()
0