結果

問題 No.1823 Tricolor Dango
ユーザー se1ka2
提出日時 2022-01-28 21:24:37
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 361 bytes
コンパイル時間 812 ms
コンパイル使用メモリ 69,888 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-30 04:37:37
合計ジャッジ時間 2,895 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <iostream>
using namespace std;
typedef long long ll;

int main()
{
	int t;
	cin >> t;
	while(t--){
		int n;
		cin >> n;
		ll a[200005];
		ll s = 0;
		for(int i = 0; i < n; i++){
			cin >> a[i];
			s += a[i];
		}
		sort(a, a + n, greater<ll>());
		if(s % 3 || a[0] * 3 > s) cout << "No" << endl;
		else cout << "Yes" << endl;
	}
}
0