結果

問題 No.1823 Tricolor Dango
ユーザー yansi819yansi819
提出日時 2024-03-20 17:40:43
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 430 bytes
コンパイル時間 4,379 ms
コンパイル使用メモリ 262,560 KB
実行使用メモリ 6,548 KB
最終ジャッジ日時 2024-03-20 17:40:50
合計ジャッジ時間 6,598 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 29 ms
6,548 KB
testcase_08 AC 27 ms
6,548 KB
testcase_09 AC 31 ms
6,548 KB
testcase_10 AC 31 ms
6,548 KB
testcase_11 AC 32 ms
6,548 KB
testcase_12 AC 26 ms
6,548 KB
testcase_13 AC 29 ms
6,548 KB
testcase_14 AC 32 ms
6,548 KB
testcase_15 AC 27 ms
6,548 KB
testcase_16 AC 12 ms
6,548 KB
testcase_17 AC 17 ms
6,548 KB
testcase_18 AC 30 ms
6,548 KB
testcase_19 AC 83 ms
6,548 KB
testcase_20 AC 30 ms
6,548 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;

int T, N, A[202020];
ll sum;

void solve() {
  cin >> N;
  sum = 0;
  for (int i = 1; i <= N; i++) { 
    cin >> A[i];
    sum += A[i];
  }
  if (sum % 3 == 0 && *max_element(A, A + N) <= sum / 3) cout << "Yes" << endl;
  else cout << "No" << endl;
}

int main() {
  cin >> T;
  while (T--) solve();
  return 0;
}
0