結果

問題 No.1823 Tricolor Dango
ユーザー Nzt3Nzt3
提出日時 2022-01-28 22:14:23
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 441 bytes
コンパイル時間 2,092 ms
コンパイル使用メモリ 203,708 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-28 20:16:07
合計ジャッジ時間 3,827 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 14 ms
4,376 KB
testcase_07 AC 14 ms
4,380 KB
testcase_08 AC 14 ms
4,380 KB
testcase_09 AC 16 ms
4,376 KB
testcase_10 AC 15 ms
4,380 KB
testcase_11 WA -
testcase_12 AC 13 ms
4,376 KB
testcase_13 AC 16 ms
4,380 KB
testcase_14 AC 16 ms
4,376 KB
testcase_15 AC 14 ms
4,376 KB
testcase_16 AC 7 ms
4,376 KB
testcase_17 AC 8 ms
4,376 KB
testcase_18 AC 17 ms
4,376 KB
testcase_19 AC 40 ms
4,380 KB
testcase_20 AC 17 ms
4,380 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
権限があれば一括ダウンロードができます

ソースコード

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