結果

問題 No.476 正しくない平均
ユーザー hum_ophum_op
提出日時 2017-04-15 20:58:08
言語 F#
(.NET 7)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 417 bytes
コンパイル時間 3,373 ms
コンパイル使用メモリ 166,840 KB
実行使用メモリ 24,388 KB
最終ジャッジ日時 2023-09-25 22:25:18
合計ジャッジ時間 6,655 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
22,368 KB
testcase_01 AC 71 ms
22,376 KB
testcase_02 AC 72 ms
22,292 KB
testcase_03 AC 72 ms
24,336 KB
testcase_04 AC 71 ms
22,256 KB
testcase_05 AC 72 ms
22,336 KB
testcase_06 AC 71 ms
20,344 KB
testcase_07 AC 70 ms
22,284 KB
testcase_08 AC 71 ms
22,256 KB
testcase_09 AC 71 ms
22,336 KB
testcase_10 AC 71 ms
22,340 KB
testcase_11 AC 71 ms
22,184 KB
testcase_12 AC 73 ms
22,496 KB
testcase_13 AC 74 ms
22,260 KB
testcase_14 AC 73 ms
22,300 KB
testcase_15 AC 73 ms
22,404 KB
testcase_16 AC 72 ms
24,292 KB
testcase_17 AC 71 ms
22,364 KB
testcase_18 AC 72 ms
22,396 KB
testcase_19 AC 71 ms
22,328 KB
testcase_20 AC 73 ms
22,332 KB
testcase_21 AC 72 ms
22,372 KB
testcase_22 AC 72 ms
22,392 KB
testcase_23 AC 75 ms
22,300 KB
testcase_24 AC 71 ms
24,388 KB
testcase_25 AC 72 ms
24,296 KB
testcase_26 AC 71 ms
22,248 KB
testcase_27 AC 72 ms
22,384 KB
testcase_28 AC 71 ms
22,240 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

open System
let No476 () =
    let IN = Console.ReadLine().Split(' ')
    let n = float <| IN.[0]
    let a = float <| IN.[1]
    let x = Console.ReadLine().Split(' ') |> Array.map (fun xi-> Double.Parse xi)

    let getSum s x = s + x
    let average = x |> Array.reduce getSum |> (fun sum-> sum / (float)x.Length)

    if (float)a = average then
        printfn "YES"
    else
        printfn "NO"

    ()

No476 ()
0