結果
問題 | No.1823 Tricolor Dango |
ユーザー |
![]() |
提出日時 | 2022-01-30 08:32:30 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 85 ms / 2,000 ms |
コード長 | 587 bytes |
コンパイル時間 | 1,564 ms |
コンパイル使用メモリ | 170,444 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-11 08:09:07 |
合計ジャッジ時間 | 4,224 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 25 |
ソースコード
/** * @FileName a.cpp * @Author kanpurin * @Created 2022.01.30 08:32:23 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { int t;cin >> t; while(t--) { int n;cin >> n; vector<int> a(n); ll sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sort(a.begin(), a.end()); if (sum % 3 != 0) { puts("No"); continue; } if (sum / 3 >= a.back()) puts("Yes"); else puts("No"); } return 0; }