結果
| 問題 |
No.1823 Tricolor Dango
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-16 22:24:36 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 116 ms / 2,000 ms |
| コード長 | 608 bytes |
| コンパイル時間 | 4,349 ms |
| コンパイル使用メモリ | 252,000 KB |
| 最終ジャッジ日時 | 2025-01-27 12:47:52 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 25 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using 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);
ll s = 0;
rep(i, n){
cin >> a[i];
s += a[i];
}
ll m = *max_element(all(a));
if(s % 3 == 0 && (3 * m <= s)){
cout << "Yes" << endl;
}
else cout << "No" << endl;
continue;
}
return 0;
}