Submission #704696

#TimeUsernameProblemLanguageResultExecution timeMemory
704696delreyAkcija (COCI15_akcija)C++14
80 / 80
36 ms1196 KiB
#include <iostream> #include <bits/stdc++.h> using namespace std; int main() { int n, a[100000], v=0; cin >> n; for (int i=0; i<n; i++) cin >> a[i]; sort(a, a+n); for (int i=0; i<n; i++) v+=a[i]; for (int i = n - 3; i>=0; i-=3) { v=v-a[i]; } cout << v; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...