# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
251645 | VEGAnn | Akcija (COCI15_akcija) | C++14 | 26 ms | 1280 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;
typedef long long ll;
const int N = 100100;
int n, a[N];
int main() {
#ifdef _LOCAL
freopen("in.txt","r",stdin); // freopen("output.txt","w",stdout);
#else
// freopen("mining.in","r",stdin); freopen("mining.out","w",stdout);
ios_base::sync_with_stdio(0); cin.tie(0);
#endif
cin >> n;
for (int i = 0; i < n; i++)
cin >> a[i];
sort(a, a + n);
reverse(a, a + n);
ll ans = 0;
for (int i = 0; i < n; i++)
if (i % 3 != 2)
ans += a[i];
cout << ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |