Submission #339166

# Submission time Handle Problem Language Result Execution time Memory
339166 2020-12-24T18:16:57 Z ammar2000 Akcija (COCI15_akcija) C++17
80 / 80
36 ms 1388 KB
#include <bits/stdc++.h>

using namespace std;
int n,sum;
int a[100000000];
int main()
{
    cin>>n;
    for (int i=1;i<=n;i++)
        cin>>a[i];
    sort (a+1,a+n+1);
    reverse(a+1,a+n+1);
    for (int i=1;i<=n;i++)
    {
        if (i%3)
            sum+=a[i];
    }
    cout <<sum;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 28 ms 1132 KB Output is correct
7 Correct 25 ms 1132 KB Output is correct
8 Correct 24 ms 1132 KB Output is correct
9 Correct 36 ms 1388 KB Output is correct
10 Correct 36 ms 1260 KB Output is correct