Submission #153854

#TimeUsernameProblemLanguageResultExecution timeMemory
153854Ruxandra985Baloni (COCI15_baloni)C++14
100 / 100
105 ms1784 KiB
#include <cstdio> #include <algorithm> #include <deque> using namespace std; int f[1000010]; int main() { FILE *fin = stdin; FILE *fout = stdout; int n,i,x; int sol = 0; fscanf (fin,"%d",&n); for (i=1;i<=n;i++){ fscanf(fin,"%d",&x); if (!f[x+1]) sol++; else f[x+1]--; f[x]++; } fprintf (fout,"%d",sol); return 0; }

Compilation message (stderr)

baloni.cpp: In function 'int main()':
baloni.cpp:12:12: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     fscanf (fin,"%d",&n);
     ~~~~~~~^~~~~~~~~~~~~
baloni.cpp:14:15: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         fscanf(fin,"%d",&x);
         ~~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...