結果

問題 No.3165 [Cherry 7th Tune A] Croissants Continu
ユーザー ortogawa
提出日時 2025-07-25 10:48:34
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 419 bytes
コンパイル時間 2,511 ms
コンパイル使用メモリ 200,836 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-07-25 10:48:42
合計ジャッジ時間 7,436 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other AC * 9 WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define int ll
#define fast_io cin.tie(0)->sync_with_stdio(0);
#define endl '\n'
typedef long long ll;

int32_t main() {
	fast_io;

	int t; cin >> t;
	while (t--) {
		int n; cin >> n;
		vector<int> a(n);
		for (auto &i : a) cin >> i;
		sort(a.rbegin(), a.rend());
		int mx = a[0];
		int s = accumulate(a.begin() + 1, a.end(), 0ll);
		cout << mx + max(mx, s) << endl;
	}
}
0