Submission #704696

# Submission time Handle Problem Language Result Execution time Memory
704696 2023-03-02T16:23:39 Z delrey Akcija (COCI15_akcija) C++14
80 / 80
36 ms 1196 KB
#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n, a[100000], v=0;
    cin >> n;
    for (int i=0; i<n; i++)
        cin >> a[i];
    sort(a, a+n);
    for (int i=0; i<n; i++)
            v+=a[i];
    for (int i = n - 3; i>=0; i-=3)
    {
        v=v-a[i];
    }
    cout << v;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 596 KB Output is correct
2 Correct 1 ms 596 KB Output is correct
3 Correct 1 ms 596 KB Output is correct
4 Correct 1 ms 596 KB Output is correct
5 Correct 1 ms 596 KB Output is correct
6 Correct 26 ms 1108 KB Output is correct
7 Correct 21 ms 1000 KB Output is correct
8 Correct 21 ms 1024 KB Output is correct
9 Correct 32 ms 1196 KB Output is correct
10 Correct 36 ms 1128 KB Output is correct