結果

問題 No.476 正しくない平均
ユーザー hum_ophum_op
提出日時 2017-04-15 20:57:02
言語 F#
(F# 4.0)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 414 bytes
コンパイル時間 5,501 ms
コンパイル使用メモリ 162,628 KB
実行使用メモリ 24,620 KB
最終ジャッジ日時 2023-09-25 22:25:07
合計ジャッジ時間 7,665 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
22,344 KB
testcase_01 AC 75 ms
22,392 KB
testcase_02 AC 75 ms
22,424 KB
testcase_03 AC 75 ms
22,412 KB
testcase_04 AC 75 ms
22,404 KB
testcase_05 AC 74 ms
22,432 KB
testcase_06 AC 73 ms
22,352 KB
testcase_07 AC 73 ms
22,392 KB
testcase_08 AC 74 ms
24,404 KB
testcase_09 AC 75 ms
22,356 KB
testcase_10 AC 74 ms
24,332 KB
testcase_11 AC 74 ms
22,572 KB
testcase_12 AC 75 ms
22,444 KB
testcase_13 AC 75 ms
24,488 KB
testcase_14 AC 74 ms
22,452 KB
testcase_15 AC 73 ms
20,384 KB
testcase_16 AC 74 ms
24,488 KB
testcase_17 AC 74 ms
24,404 KB
testcase_18 AC 76 ms
22,512 KB
testcase_19 AC 74 ms
22,348 KB
testcase_20 AC 73 ms
24,620 KB
testcase_21 AC 74 ms
22,360 KB
testcase_22 AC 72 ms
22,460 KB
testcase_23 AC 75 ms
22,452 KB
testcase_24 AC 76 ms
22,568 KB
testcase_25 AC 73 ms
22,464 KB
testcase_26 AC 74 ms
22,420 KB
testcase_27 AC 74 ms
22,412 KB
testcase_28 AC 75 ms
22,480 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 = int <| IN.[0]
    let a = int <| 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