# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
708984 | vjudge1 | Akcija (COCI15_akcija) | C++17 | 34 ms | 1060 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 |
---|---|---|---|---|
Fetching results... |