Submission #1084066

# Submission time Handle Problem Language Result Execution time Memory
1084066 2024-09-05T03:37:45 Z overwatch9 Akcija (COCI15_akcija) C++17
16 / 80
24 ms 836 KB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
    int n;
    cin >> n;
    vector <int> nums(n);
    for (int i = 0; i < n; i++)
        cin >> nums[i];
    sort(nums.begin(), nums.end());
    ll ans = 0;
    for (int i = n-1, x = 0; i >= 0; i--, x++) {
        x %= 3;
        if (x == 0 && i-2 >= 0)
            continue;
        ans += nums[i];
    }
    cout << ans << '\n';
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Incorrect 1 ms 348 KB Output isn't correct
6 Incorrect 16 ms 836 KB Output isn't correct
7 Correct 19 ms 604 KB Output is correct
8 Correct 14 ms 828 KB Output is correct
9 Incorrect 22 ms 836 KB Output isn't correct
10 Incorrect 24 ms 604 KB Output isn't correct