結果
問題 |
No.1823 Tricolor Dango
|
ユーザー |
|
提出日時 | 2022-01-29 09:29:58 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 75 ms / 2,000 ms |
コード長 | 468 bytes |
コンパイル時間 | 1,666 ms |
コンパイル使用メモリ | 167,452 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-31 18:20:26 |
合計ジャッジ時間 | 4,526 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 25 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; for(int i=0;i<t;i++) { int n; cin >> n; int a[n]; string out = "Yes"; long long total = 0; int maxA = 0; for(int j=0;j<n;j++) { cin >> a[j]; total += a[j]; maxA = max(maxA, a[j]); } if(total % 3 != 0 || maxA > total / 3) out = "No"; cout << out << '\n'; } }