Submission #44673

#TimeUsernameProblemLanguageResultExecution timeMemory
44673heonAkcija (COCI15_akcija)C++11
80 / 80
56 ms3420 KiB
#include<iostream> #include<algorithm> using namespace std; const int MAXN = 100001; int n; int arr[MAXN]; long long sol = 0; int Solve(){ int cnt = 0; for(int i = n-1; i >= 0; i--){ cnt++; if(cnt % 3 == 0){ continue; } else sol += arr[i]; } return sol; } int main(){ cin >> n; for(int i = 0; i < n; i++){ cin >> arr[i]; } sort(arr,arr+n); cout << Solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...