# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
357893 | beepbeepsheep | Akcija (COCI15_akcija) | C++17 | 18 ms | 1644 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;
#define ll long long
const ll bignum=1e17;
const int inf= 2e9;
const int mod= 1e9+7;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
ll n;
cin>>n;
ll arr[n];
for (int i=0;i<n;i++){
cin>>arr[i];
}
sort(arr,arr+n);
reverse(arr,arr+n);
ll ans=0;
for (int i=0;i<n;i++){
if (!((i+1)%3))continue;
ans+=arr[i];
}
cout<<ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |