結果

問題 No.1823 Tricolor Dango
ユーザー Nzt3
提出日時 2022-01-28 22:14:23
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 441 bytes
コンパイル時間 3,004 ms
コンパイル使用メモリ 196,412 KB
最終ジャッジ日時 2025-01-27 16:44:16
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 14 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int test_case;
  cin>>test_case;
  while (test_case--){
    int N;
    cin>>N;
    vector<int>A(N);
    for(int i=0;i<N;i++)cin>>A[i];
    long long sum=accumulate(A.begin(),A.end(),0ll);
    sort(A.begin(),A.end(),greater{});
    if(sum%3==0&&A[0]<=sum-A[0]-A[1]){
      cout<<"Yes\n";
    }else{
      cout<<"No\n";
    }
  }
}
 
0