Submission #469496

#TimeUsernameProblemLanguageResultExecution timeMemory
469496KarabasanBaloni (COCI15_baloni)C++17
100 / 100
90 ms6040 KiB
#include <bits/stdc++.h> using namespace std; int dizi[1000005]; int ind[1000005]; int n; int main() { scanf("%d",&n); for(int i=0;i<n;i++) scanf("%d",&dizi[i]); int cevap=n; for(int i=0;i<n;i++) { if(ind[dizi[i]+1]>0) { cevap--; ind[dizi[i]+1]--; } ind[dizi[i]]++; } printf("%d",cevap); return 0; }

Compilation message (stderr)

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