# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
956172 | lalig777 | Akcija (COCI15_akcija) | C++14 | 25 ms | 1372 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.
/******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long int ll;
int main(){
int n; cin>>n;
ll sum=0;
vector<int>v(n);
for (int i=0; i<n; i++){
cin>>v[i];
sum+=v[i];
}sort(v.begin(), v.end());
for (int i=n-3; i>=0; i-=3) sum-=v[i];
cout<<sum<<endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |