結果
| 問題 | No.1823 Tricolor Dango |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-07-03 22:26:48 |
| 言語 | C++23(gnu拡張) (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 11 ms / 2,000 ms |
| コード長 | 1,042 bytes |
| 記録 | |
| コンパイル時間 | 4,682 ms |
| コンパイル使用メモリ | 359,952 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-07-03 22:27:01 |
| 合計ジャッジ時間 | 6,134 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 25 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using i128 = __int128_t;
using uint = unsigned;
using ull = unsigned long long;
using u128 = __uint128_t;
using pii = pair<int, int>;
int sz(auto&& x) { return int(size(x)); }
const auto& range = views::iota;
template <typename CharT, class Traits>
auto& operator<<(basic_ostream<CharT, Traits>& os,
ranges::forward_range auto&& v) {
if (empty(v)) return os;
auto it = begin(v);
os << *it++;
while (it != end(v)) os << ' ' << *it++;
return os;
}
// End template
bool solve() {
int n;
cin >> n;
int mx = 0;
ll sum = 0;
while (n--) {
int x;
cin >> x;
mx = max(mx, x);
sum += x;
}
return sum % 3 == 0 && 3LL * mx <= sum;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int tcs = 1;
cin >> tcs;
for (int tc = 1; tc <= tcs; ++tc) {
if (solve()) {
println("Yes");
} else {
println("No");
}
}
}