結果

問題 No.1131 Deviation Score
ユーザー ngng628
提出日時 2020-08-03 15:05:49
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 576 ms / 2,000 ms
コード長 1,269 bytes
コンパイル時間 1,773 ms
コンパイル使用メモリ 112,532 KB
実行使用メモリ 28,928 KB
最終ジャッジ日時 2024-06-28 03:44:08
合計ジャッジ時間 8,753 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
class Myon
{
    public Myon() {}
	static int Main(string[] args)
	{
        cin = new Scanner();
        new Myon().calc();
        return 0;
	}

    static Scanner cin;

    void calc()
    {
        int N = cin.nextInt();
        int[] xs = cin.ArrayInt(N);

        double A = 0.0;
        foreach (int x in xs)
        {
            A += x;
        }
        A /= N;

        foreach (int x in xs)
        {
            Console.WriteLine(Math.Floor(50.0 - (A - x) / 2.0));
        }
    }
}

class Scanner
{
    string[] s;
    int i;
 
    char[] cs = new char[] { ' ' };
 
    public Scanner()
    {
        s = new string[0];
        i = 0;
    }
 
    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }
 
    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }
}
0