結果

問題 No.1823 Tricolor Dango
ユーザー Carpenters-CatCarpenters-Cat
提出日時 2022-01-28 21:27:43
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 416 bytes
コンパイル時間 2,562 ms
コンパイル使用メモリ 197,108 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-28 19:08:17
合計ジャッジ時間 4,081 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 47 ms
4,376 KB
testcase_02 AC 46 ms
4,380 KB
testcase_03 AC 47 ms
4,376 KB
testcase_04 AC 29 ms
4,376 KB
testcase_05 AC 28 ms
4,380 KB
testcase_06 AC 29 ms
4,380 KB
testcase_07 AC 26 ms
4,376 KB
testcase_08 AC 24 ms
4,380 KB
testcase_09 AC 27 ms
4,376 KB
testcase_10 AC 28 ms
4,376 KB
testcase_11 AC 30 ms
4,380 KB
testcase_12 AC 24 ms
4,380 KB
testcase_13 AC 27 ms
4,376 KB
testcase_14 AC 30 ms
4,380 KB
testcase_15 AC 25 ms
4,380 KB
testcase_16 AC 11 ms
4,376 KB
testcase_17 AC 16 ms
4,380 KB
testcase_18 AC 27 ms
4,376 KB
testcase_19 AC 75 ms
4,376 KB
testcase_20 AC 27 ms
4,376 KB
testcase_21 AC 35 ms
4,376 KB
testcase_22 AC 44 ms
4,380 KB
testcase_23 AC 30 ms
4,376 KB
testcase_24 AC 35 ms
4,376 KB
testcase_25 AC 44 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main () {
    int T;
    cin >> T;
    for (int t = 0; t < T; t ++) {
        int N;
        cin >> N;
        long long sum = 0, ma = 0;
        for (int i = 0; i < N; i ++) {
            long long a;
            cin >> a;
            sum += a;
            ma = max(ma, a);
        }
        cout << ((sum % 3 == 0 && ma <= sum / 3) ? "Yes" : "No") << endl;
    }
}
0