結果
| 問題 | No.476 正しくない平均 | 
| コンテスト | |
| ユーザー |  soi09476291 | 
| 提出日時 | 2019-11-24 08:21:46 | 
| 言語 | C#(csc) (csc 3.9.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 25 ms / 2,000 ms | 
| コード長 | 925 bytes | 
| コンパイル時間 | 705 ms | 
| コンパイル使用メモリ | 111,108 KB | 
| 実行使用メモリ | 26,272 KB | 
| 最終ジャッジ日時 | 2024-10-12 04:14:46 | 
| 合計ジャッジ時間 | 2,364 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 26 | 
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Text;
using System.Linq;
namespace ConsoleApp11
{
    class Program
    {
        static void Main(string[] args)
        {
            decimal average = 0;
            long sum = 0;
            var input = Console.ReadLine().Trim().Split(' ');
            var input1 = Console.ReadLine().Split(' ');
            long n = long.Parse(input[0]);
            long a = long.Parse(input[1]);
            long[] x = new long[n];
            for(int i = 0; i < n; i++)
            {
                x[i] = long.Parse(input1[i]);
            }
            for(long i = 0; i < n; i++)
            {
                sum += x[i];
            }
            average = (decimal)sum / x.Length;
            if(average == a)
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
        }        
    }
}
            
            
            
        