Submission #153850

#TimeUsernameProblemLanguageResultExecution timeMemory
153850Ruxandra985Baloni (COCI15_baloni)C++14
0 / 100
103 ms1400 KiB
#include <cstdio> #include <algorithm> #include <set> 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]==0) sol++; f[x] = i; } 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...