結果
問題 | No.1823 Tricolor Dango |
ユーザー | taisii2 |
提出日時 | 2022-01-28 22:09:38 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 88 ms / 2,000 ms |
コード長 | 493 bytes |
コンパイル時間 | 1,705 ms |
コンパイル使用メモリ | 167,536 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-30 07:12:56 |
合計ジャッジ時間 | 3,817 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 25 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main(){ int T; cin>>T; while(T--){ int N; cin>>N; vector<int>A(N); long long sum=0; for(int i=0;i<N;i++){ cin>>A[i]; sum+=A[i]; } bool ok=true; if(sum%3!=0){ ok=false; }else{ sum/=3; for(int i=0;i<N;i++){ if(A[i]>sum){ ok=false; break; } } } if(ok){ cout<<"Yes"<<endl; }else{ cout<<"No"<<endl; } } }