結果

問題 No.406 鴨等間隔の法則
ユーザー kuuso1kuuso1
提出日時 2016-08-16 08:09:09
言語 F#
(F# 4.0)
結果
AC  
実行時間 169 ms / 2,000 ms
コード長 457 bytes
コンパイル時間 5,026 ms
コンパイル使用メモリ 169,244 KB
実行使用メモリ 42,320 KB
最終ジャッジ日時 2023-09-21 18:02:10
合計ジャッジ時間 9,599 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
28,720 KB
testcase_01 AC 70 ms
26,244 KB
testcase_02 AC 70 ms
28,276 KB
testcase_03 AC 66 ms
24,144 KB
testcase_04 AC 148 ms
35,488 KB
testcase_05 AC 103 ms
29,216 KB
testcase_06 AC 104 ms
27,264 KB
testcase_07 AC 103 ms
29,352 KB
testcase_08 AC 145 ms
35,488 KB
testcase_09 AC 154 ms
36,048 KB
testcase_10 AC 108 ms
30,680 KB
testcase_11 AC 138 ms
36,684 KB
testcase_12 AC 115 ms
31,380 KB
testcase_13 AC 115 ms
31,120 KB
testcase_14 AC 152 ms
40,388 KB
testcase_15 AC 78 ms
26,744 KB
testcase_16 AC 84 ms
27,376 KB
testcase_17 AC 81 ms
26,880 KB
testcase_18 AC 83 ms
25,396 KB
testcase_19 AC 84 ms
25,348 KB
testcase_20 AC 88 ms
23,476 KB
testcase_21 AC 88 ms
25,600 KB
testcase_22 AC 100 ms
26,404 KB
testcase_23 AC 115 ms
29,488 KB
testcase_24 AC 141 ms
35,936 KB
testcase_25 AC 154 ms
36,008 KB
testcase_26 AC 169 ms
42,260 KB
testcase_27 AC 132 ms
31,988 KB
testcase_28 AC 150 ms
38,320 KB
testcase_29 AC 169 ms
42,320 KB
testcase_30 AC 167 ms
41,968 KB
testcase_31 AC 152 ms
35,868 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

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