結果

問題 No.1823 Tricolor Dango
ユーザー lucky3977
提出日時 2022-02-04 21:09:36
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 574 bytes
コンパイル時間 2,391 ms
コンパイル使用メモリ 192,812 KB
最終ジャッジ日時 2025-01-27 18:36:08
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;

using ll = long long;
const int INF = 1<<30;
const long long LINF = 1LL<<60;
const long long MOD = (long long)1e9 + 7;

int main(){
    int t;
    cin >> t;
    while(t--){
        int n;
        cin >> n;
        ll m = 0, sum = 0;
        for(int i = 0; i < n; i++){
            ll a;
            cin >> a;
            m = max(a, m);
            sum += a;
        }
        if(sum % 3 == 0 && m <= sum / 3 ){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }
    return 0;
}
0