結果
| 問題 | No.1823 Tricolor Dango |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-28 21:29:59 |
| 言語 | C++17(clang) (clang++ 22.1.2 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 24 ms / 2,000 ms |
| コード長 | 458 bytes |
| 記録 | |
| コンパイル時間 | 2,982 ms |
| コンパイル使用メモリ | 177,152 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-03 21:25:01 |
| 合計ジャッジ時間 | 4,675 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 25 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0)->sync_with_stdio(0);
int t; cin >> t; while (t--) {
int n;
cin >> n;
vector<int> a(n);
for (auto& ai : a) {
cin >> ai;
}
sort(a.begin(), a.end());
int64_t s = 0;
for (auto ai : a) {
s += ai;
}
if ((s % 3 != 0) ||
(a[n - 1] > s / 3)) {
cout << "No\n";
} else {
cout << "Yes\n";
}
}
return 0;
}