結果

問題 No.1823 Tricolor Dango
ユーザー ぷら
提出日時 2022-01-28 21:23:38
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 106 ms / 2,000 ms
コード長 481 bytes
コンパイル時間 1,997 ms
コンパイル使用メモリ 200,988 KB
最終ジャッジ日時 2025-01-27 16:01:56
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    int t;
    cin >> t;
    while (t--) {
        int N;
        cin >> N;
        vector<int>A(N);
        long long sum = 0;
        for(int i = 0; i < N; i++) {
            cin >> A[i];
            sum += A[i];
        }
        sort(A.rbegin(),A.rend());
        if(sum%3 == 0 && (sum-A[0])/2 >= A[0]) {
            cout << "Yes" << endl;
        }
        else {
            cout << "No" << endl;
        }
    }
}
0