Submission #708984

# Submission time Handle Problem Language Result Execution time Memory
708984 2023-03-13T03:33:14 Z vjudge1 Akcija (COCI15_akcija) C++17
80 / 80
34 ms 1060 KB
#include <bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define sz size()
using namespace std;
int main() {
    ll n;
    cin>>n;
    ll a[n],s=0,x=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        s+=a[i];
    }
    sort(a,a+n);
    reverse(a,a+n);
    for(int i=2;i<n;i+=3)x+=a[i];
    cout<<s-x;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 25 ms 1056 KB Output is correct
7 Correct 21 ms 980 KB Output is correct
8 Correct 22 ms 1056 KB Output is correct
9 Correct 34 ms 1060 KB Output is correct
10 Correct 30 ms 980 KB Output is correct