# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1130608 | lopkus | Akcija (COCI15_akcija) | C++20 | 14 ms | 1096 KiB |
#include <bits/stdc++.h>
#define int long long
using namespace std;
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
vector<int> a(n + 1);
for(int i = 1; i <= n; i++) {
cin >> a[i];
}
sort(a.begin() + 1, a.end());
reverse(a.begin() + 1, a.end());
int ans = 0;
for(int i = 1; i <= n; i++) {
if(i % 3 == 0) {
continue;
}
ans += a[i];
}
cout << ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |