# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
165815 | Abdulaziz_Kazim | Akcija (COCI15_akcija) | C++17 | 60 ms | 760 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 main()
{
// freopen("a.gir","r",stdin);
// freopen("a.cik","w",stdout);
int n;
int dizi[100007];
cin >> n;
for(int i=0;i<n;i++)
{
cin >> dizi[i];
}
sort(dizi,dizi+n);
long long int fiyat=0;
int i;
for(i=0;i<n%3;i++)
{
fiyat+=dizi[i];
}
for(;i<n-2;i+=3)
{
fiyat+=dizi[i+1]+dizi[i+2];
}
cout << fiyat;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |