Submission #163864

#TimeUsernameProblemLanguageResultExecution timeMemory
163864beso123Akcija (COCI15_akcija)C++14
80 / 80
59 ms1656 KiB
#include <bits/stdc++.h> #define int long long using namespace std; int n,a[100001]; main(){ cin>>n; for(int k=1;k<=n;k++) cin>>a[k]; int ans=0; sort(a+1,a+n+1); reverse(a+1,a+n+1); for(int k=1;k<=n;k++) if(k%3!=0) ans+=a[k]; cout<<ans; return 0; }

Compilation message (stderr)

akcija.cpp:5:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main(){
      ^
akcija.cpp: In function 'int main()':
akcija.cpp:12:1: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 for(int k=1;k<=n;k++)
 ^~~
akcija.cpp:15:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
     cout<<ans;
     ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...