# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
44673 | heon | Akcija (COCI15_akcija) | C++11 | 56 ms | 3420 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<iostream>
#include<algorithm>
using namespace std;
const int MAXN = 100001;
int n;
int arr[MAXN];
long long sol = 0;
int Solve(){
int cnt = 0;
for(int i = n-1; i >= 0; i--){
cnt++;
if(cnt % 3 == 0){
continue;
}
else sol += arr[i];
}
return sol;
}
int main(){
cin >> n;
for(int i = 0; i < n; i++){
cin >> arr[i];
}
sort(arr,arr+n);
cout << Solve();
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |