Submission #165814

#TimeUsernameProblemLanguageResultExecution timeMemory
165814ArKCaAkcija (COCI15_akcija)C++17
80 / 80
25 ms1016 KiB
#include<bits/stdc++.h> #define ll long long #define mod 1000000007 #define pb push_back #define pob pop_back #define N 10 using namespace std; vector<int>v; int n; ll tot; int main(){ // freopen("a.gir","r",stdin); // freopen("a.cik","w",stdout); scanf("%d",&n); int a; for(int i=0;i<n;i++){ scanf("%d",&a); v.pb(a); tot+=a; } sort(v.begin(), v.end()); ll ans=0; for(int i=(n-3);i>=0;i-=3){ ans+=v[i]; } printf("%lld\n",tot-ans ); }

Compilation message (stderr)

akcija.cpp: In function 'int main()':
akcija.cpp:15:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
  ~~~~~^~~~~~~~~
akcija.cpp:18:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&a);
   ~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...