結果

問題 No.1131 Deviation Score
ユーザー ngng628ngng628
提出日時 2020-08-03 15:05:49
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 640 ms / 2,000 ms
コード長 1,269 bytes
コンパイル時間 1,363 ms
コンパイル使用メモリ 63,520 KB
実行使用メモリ 34,144 KB
最終ジャッジ日時 2023-09-10 12:25:10
合計ジャッジ時間 9,979 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 185 ms
26,232 KB
testcase_01 AC 78 ms
25,080 KB
testcase_02 AC 583 ms
34,144 KB
testcase_03 AC 288 ms
25,248 KB
testcase_04 AC 504 ms
33,632 KB
testcase_05 AC 228 ms
24,484 KB
testcase_06 AC 555 ms
33,984 KB
testcase_07 AC 288 ms
27,480 KB
testcase_08 AC 476 ms
31,360 KB
testcase_09 AC 225 ms
24,360 KB
testcase_10 AC 462 ms
33,324 KB
testcase_11 AC 487 ms
33,412 KB
testcase_12 AC 431 ms
30,700 KB
testcase_13 AC 542 ms
31,908 KB
testcase_14 AC 166 ms
24,116 KB
testcase_15 AC 164 ms
26,020 KB
testcase_16 AC 506 ms
33,600 KB
testcase_17 AC 243 ms
26,748 KB
testcase_18 AC 640 ms
32,700 KB
testcase_19 AC 75 ms
24,808 KB
testcase_20 AC 64 ms
24,792 KB
testcase_21 AC 64 ms
22,848 KB
権限があれば一括ダウンロードができます

ソースコード

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