# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
113072 | CaQtiml | Akcija (COCI15_akcija) | C++14 | 36 ms | 1016 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"
using namespace std;
int arr[(int)1e5+10];
long long sum;
int main()
{
int n;
cin >> n;
int rob = n/3;
for(int i=1;i<=n;i++)
{
cin >> arr[i];
sum+=arr[i];
}
sort(arr+1,arr+1+n);
long long ans=0;
for(int i=n-2;i>=1;i-=3)
{
ans+=arr[i];
//cout << ans << "\n";
}
//for(int i=(3*rob+1);i<=n;i++) ans+=arr[i];
cout << sum-ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |