Submission #708984

#TimeUsernameProblemLanguageResultExecution timeMemory
708984vjudge1Akcija (COCI15_akcija)C++17
80 / 80
34 ms1060 KiB
#include <bits/stdc++.h> #define ll long long #define ff first #define ss second #define pb push_back #define mp make_pair #define sz size() using namespace std; int main() { ll n; cin>>n; ll a[n],s=0,x=0; for(int i=0;i<n;i++){ cin>>a[i]; s+=a[i]; } sort(a,a+n); reverse(a,a+n); for(int i=2;i<n;i+=3)x+=a[i]; cout<<s-x; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...