結果

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

ソースコード

diff #

#include <bits/stdc++.h>
#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
#include<string>
using ll = long long;
using namespace std;

int main()
{
    ll t, n;
    cin >> t;
    for (ll i = 0; i < t; i++){
        ll sum1 = 0, max1 = -1;
        cin >> n;
        vector<ll> a(n);
        for (ll j = 0; j < n; j++){
            cin >> a[j];
            sum1 += a[j];
            max1 = max(max1, a[j]);
        }
        cout << ((!(sum1%3) && max1 <= sum1/3) ? "Yes" : "No") << endl;
    }
}
0