結果

問題 No.1823 Tricolor Dango
ユーザー bluemeganebluemegane
提出日時 2022-01-29 07:22:52
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 146 ms / 2,000 ms
コード長 605 bytes
コンパイル時間 1,026 ms
コンパイル使用メモリ 67,884 KB
実行使用メモリ 42,436 KB
最終ジャッジ日時 2023-08-30 03:59:03
合計ジャッジ時間 5,397 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
21,488 KB
testcase_01 AC 122 ms
25,744 KB
testcase_02 AC 120 ms
27,628 KB
testcase_03 AC 120 ms
27,700 KB
testcase_04 AC 98 ms
25,872 KB
testcase_05 AC 98 ms
25,688 KB
testcase_06 AC 100 ms
28,016 KB
testcase_07 AC 102 ms
30,808 KB
testcase_08 AC 98 ms
32,424 KB
testcase_09 AC 104 ms
33,332 KB
testcase_10 AC 102 ms
31,148 KB
testcase_11 AC 101 ms
31,152 KB
testcase_12 AC 98 ms
30,392 KB
testcase_13 AC 98 ms
25,520 KB
testcase_14 AC 101 ms
30,000 KB
testcase_15 AC 93 ms
27,388 KB
testcase_16 AC 79 ms
23,664 KB
testcase_17 AC 82 ms
23,856 KB
testcase_18 AC 98 ms
30,344 KB
testcase_19 AC 146 ms
42,436 KB
testcase_20 AC 96 ms
30,372 KB
testcase_21 AC 103 ms
25,580 KB
testcase_22 AC 119 ms
25,712 KB
testcase_23 AC 101 ms
23,788 KB
testcase_24 AC 102 ms
25,580 KB
testcase_25 AC 118 ms
25,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System.Linq;
using System;

public class Hello
{
    static void Main()
    {
        var t = int.Parse(Console.ReadLine().Trim());
        while (t-->0)
        {
            var n = int.Parse(Console.ReadLine().Trim());
            string[] line = Console.ReadLine().Trim().Split(' ');
            var a = Array.ConvertAll(line, long.Parse);
			getAns(n,a);
        }
    }
	static void getAns (int n, long[] a)
    {
        var sum = a.Sum();
        if (sum % 3 != 0) { Console.WriteLine("No"); return; }
        var max = a.Max();
        Console.WriteLine(max <= sum/3L? "Yes":"No");
    }
}
0