Submission #104662

#TimeUsernameProblemLanguageResultExecution timeMemory
104662MatesV13Akcija (COCI15_akcija)C++11
80 / 80
20 ms1280 KiB
#include <bits/stdc++.h> using namespace std; int n, c[100055]; long long sum, freebook; int main (){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n; for (int i=0;i<n;i++){ cin >> c[i]; sum += c[i]; } sort (c, c+n); for (int i=n-3;i>=0;i-=3){ freebook += c[i]; } cout << sum - freebook; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...