結果

問題 No.406 鴨等間隔の法則
ユーザー taktak
提出日時 2018-04-13 15:19:09
言語 F#
(F# 4.0)
結果
AC  
実行時間 191 ms / 2,000 ms
コード長 345 bytes
コンパイル時間 3,212 ms
コンパイル使用メモリ 155,424 KB
実行使用メモリ 44,540 KB
最終ジャッジ日時 2023-09-21 18:47:11
合計ジャッジ時間 9,512 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
30,824 KB
testcase_01 AC 88 ms
24,820 KB
testcase_02 AC 89 ms
24,756 KB
testcase_03 AC 85 ms
22,928 KB
testcase_04 AC 175 ms
41,316 KB
testcase_05 AC 122 ms
31,916 KB
testcase_06 AC 123 ms
30,096 KB
testcase_07 AC 123 ms
28,028 KB
testcase_08 AC 172 ms
39,052 KB
testcase_09 AC 183 ms
40,404 KB
testcase_10 AC 129 ms
31,052 KB
testcase_11 AC 162 ms
37,176 KB
testcase_12 AC 138 ms
33,300 KB
testcase_13 AC 134 ms
31,792 KB
testcase_14 AC 173 ms
40,200 KB
testcase_15 AC 95 ms
23,684 KB
testcase_16 AC 102 ms
26,276 KB
testcase_17 AC 99 ms
27,524 KB
testcase_18 AC 102 ms
28,276 KB
testcase_19 AC 102 ms
24,416 KB
testcase_20 AC 107 ms
26,692 KB
testcase_21 AC 108 ms
26,920 KB
testcase_22 AC 115 ms
28,020 KB
testcase_23 AC 138 ms
34,520 KB
testcase_24 AC 164 ms
39,016 KB
testcase_25 AC 182 ms
42,240 KB
testcase_26 AC 190 ms
42,448 KB
testcase_27 AC 171 ms
40,196 KB
testcase_28 AC 178 ms
40,240 KB
testcase_29 AC 191 ms
44,540 KB
testcase_30 AC 190 ms
44,404 KB
testcase_31 AC 180 ms
39,924 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

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