QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#545471#5122. Strange Sumucup-team1329#WA 1ms3500kbC++20869b2024-09-03 13:32:242024-09-03 13:32:24

Judging History

你现在查看的是最新测评结果

  • [2024-09-03 13:32:24]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3500kb
  • [2024-09-03 13:32:24]
  • 提交

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;
}

Details

Tip: Click on the bar to expand more detailed information

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'