結果

問題 No.1823 Tricolor Dango
ユーザー Shirotsume
提出日時 2022-01-16 22:13:02
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 565 bytes
コンパイル時間 4,309 ms
コンパイル使用メモリ 250,056 KB
最終ジャッジ日時 2025-01-27 12:47:12
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 1 WA * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define ll long long
#define all(x) x.begin(),x.end() 
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(void)
{
    ll t;
    cin >> t;
    while(t--){
        ll n;
        cin >> n;
        vector<ll> a(n);
        rep(i, n) cin >> a[i];
        ll s = accumulate(all(a), 0);
        ll m = *max_element(all(a));
        if(s % 3 == 0 && (m <= s / 3)){
            cout << "Yes" << endl;
        }
        else cout << "No" << endl;


    }
    return 0;
}
0