Submission #154128

#TimeUsernameProblemLanguageResultExecution timeMemory
154128Linca_RobertAkcija (COCI15_akcija)C++14
80 / 80
59 ms1456 KiB
#include<iostream> #include<algorithm> using namespace std; int N, arr[1000005]; long long sum = 0; int main(){ cin >> N; for( int i = 1; i <= N; i++ ) cin >> arr[i]; sort( arr + 1, arr + N + 1 ); for( int i = N; i >= 1; i -= 3 ){ sum += arr[i] + arr[i - 1]; } cout << sum << "\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...