結果
| 問題 |
No.476 正しくない平均
|
| ユーザー |
hum_op
|
| 提出日時 | 2017-04-15 20:57:02 |
| 言語 | F# (F# 4.0) |
| 結果 |
AC
|
| 実行時間 | 80 ms / 2,000 ms |
| コード長 | 414 bytes |
| コンパイル時間 | 11,747 ms |
| コンパイル使用メモリ | 187,612 KB |
| 実行使用メモリ | 32,256 KB |
| 最終ジャッジ日時 | 2024-07-18 18:04:23 |
| 合計ジャッジ時間 | 15,180 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (310 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
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 ()
hum_op