QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#545471 | #5122. Strange Sum | ucup-team1329# | WA | 1ms | 3500kb | C++20 | 869b | 2024-09-03 13:32:24 | 2024-09-03 13:32:24 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
// int dir[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
// int dir[8][2] = {{1, 0}, {1, -1}, {1, 1}, {0, 1}, {0, -1}, {-1, 1}, {-1, 0}, {-1, -1}};
const int INF = 0x3f3f3f3f;
const double Pi = acos(-1);
void solve() {
int n;
cin >> n;
vector<int> a(n + 1);
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
sort(a.begin() + 1, a.end(), greater<int>());
cout << max({0, a[0], a[0] + a[1]}) << '\n';
return;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
// cout << fixed << setprecision(15);
int T = 1;
// cin >> T;
while (T--) {
solve();
}
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3500kb
input:
4 1 4 3 2
output:
4
result:
wrong answer 1st numbers differ - expected: '7', found: '4'