結果

問題 No.1823 Tricolor Dango
ユーザー boatmusclesboatmuscles
提出日時 2022-01-28 21:39:41
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 470 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 45,840 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-28 19:25:51
合計ジャッジ時間 1,716 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 15 ms
4,380 KB
testcase_02 AC 15 ms
4,376 KB
testcase_03 AC 15 ms
4,380 KB
testcase_04 AC 12 ms
4,376 KB
testcase_05 AC 11 ms
4,376 KB
testcase_06 AC 12 ms
4,376 KB
testcase_07 AC 11 ms
4,376 KB
testcase_08 AC 10 ms
4,380 KB
testcase_09 AC 12 ms
4,380 KB
testcase_10 AC 11 ms
4,376 KB
testcase_11 AC 12 ms
4,376 KB
testcase_12 AC 10 ms
4,376 KB
testcase_13 AC 11 ms
4,380 KB
testcase_14 AC 12 ms
4,380 KB
testcase_15 AC 11 ms
4,380 KB
testcase_16 AC 5 ms
4,380 KB
testcase_17 AC 6 ms
4,380 KB
testcase_18 AC 11 ms
4,376 KB
testcase_19 AC 28 ms
4,376 KB
testcase_20 AC 12 ms
4,376 KB
testcase_21 AC 12 ms
4,376 KB
testcase_22 AC 15 ms
4,376 KB
testcase_23 AC 12 ms
4,376 KB
testcase_24 AC 13 ms
4,376 KB
testcase_25 AC 14 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<cstdio>
#include<numeric>
#include<algorithm>
using namespace std;
using ll = long long;
using ull = unsigned long long;

int main(){
    int T;
    scanf("%d", &T);
    for (int ___ = 0; ___ < T; ___++){
        int N;
        scanf("%d", &N);
        unsigned A[N];
        for(int i = 0; i < N; ++i) scanf("%u", A + i);
        ull sum = accumulate(A,A+N,0ULL);
        printf((sum%3) || *max_element(A,A+N)*3 > sum ? "No\n" : "Yes\n");
    }
    return 0;
}
0