Submission #1084064

#TimeUsernameProblemLanguageResultExecution timeMemory
1084064overwatch9Akcija (COCI15_akcija)C++17
40 / 80
25 ms1372 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int n; cin >> n; vector <int> nums(n); for (int i = 0; i < n; i++) cin >> nums[i]; sort(nums.begin(), nums.end()); ll ans = 0; for (int i = 0; i < n; i++) { if (i % 3 == 0 && i+2 < n) continue; ans += nums[i]; } cout << ans << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...