# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1172663 | Nomio | Akcija (COCI15_akcija) | C++20 | 10 ms | 584 KiB |
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
int a[n];
ll s = 0;
for(int i = 0; i < n; i++) {
cin >> a[i];
s += a[i];
}
sort(a, a + n);
reverse(a, a + n);
for(int i = 2; i < n; i += 3) {
s -= a[i];
}
cout << s << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |