Submission #704695

#TimeUsernameProblemLanguageResultExecution timeMemory
704695delreyAkcija (COCI15_akcija)C++14
24 / 80
1 ms468 KiB
#include <iostream> #include <bits/stdc++.h> using namespace std; int main() { int n, a[100], 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...