# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
838657 | vjudge1 | Akcija (COCI15_akcija) | C++17 | 12 ms | 980 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 int long long
#define OYY 1000000005
#define mod 998244353
#define faster ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mid (start+end)/2
int32_t main(){
faster
int n;cin>>n;
int dizi[n];
for(int i=0;i<n;i++)cin>>dizi[i];
sort(dizi,dizi+n);
int cev=0;
int tut=n%3;
for(int i=0;i<tut;i++)cev+=dizi[i];
//cout<<cev<<endl;
for(int i=tut;i<n;i++){
if(i%3==tut)continue;
cev+=dizi[i];
}
cout<<cev<<'\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |