Submission #469874

#TimeUsernameProblemLanguageResultExecution timeMemory
469874KarabasanAkcija (COCI15_akcija)C++17
80 / 80
23 ms1612 KiB
#include <bits/stdc++.h> using namespace std; long long dizi[100005]; long long cevap; int main() { int n; scanf("%d",&n); for(int i=1;i<=n;i++) scanf("%lld",&dizi[i]); sort(dizi+1,dizi+1+n); reverse(dizi+1,dizi+1+n); for(int i=1;i<=n;i++) { if(i%3==0) dizi[i]=0; } for(int i=1;i<=n;i++) cevap+=dizi[i]; printf("%lld",cevap); return 0; }

Compilation message (stderr)

akcija.cpp: In function 'int main()':
akcija.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~
akcija.cpp:11:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |         scanf("%lld",&dizi[i]);
      |         ~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...