Submission #166415

#TimeUsernameProblemLanguageResultExecution timeMemory
166415outsiderAkcija (COCI15_akcija)C++14
80 / 80
67 ms1656 KiB
#include <bits/stdc++.h> #define ll long long using namespace std; ll n,m,s; vector<ll>a; main (){ cin>>n; a.resize(n+1); ll ans=0; for (int i=1;i<=n;i++) { cin>>a[i]; ans+=a[i]; } sort(a.begin()+1,a.end()); for (int i=n-2;i>=1;i-=3) { ans-=a[i]; } cout<<ans; return 0;}

Compilation message (stderr)

akcija.cpp:6:7: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main (){
       ^
#Verdict Execution timeMemoryGrader output
Fetching results...