Submission #90527

#TimeUsernameProblemLanguageResultExecution timeMemory
90527tjrwodnjs999볼질 (OJUZ10_ballparade)C++11
100 / 100
7 ms2500 KiB
#include <bits/stdc++.h> using namespace std; int n,m,a,b,c,d,cnt; int main(){ scanf("%d",&n); while(n--){ scanf("%d",&m); if(m==1) d++; if(m==2||d==4){ if(c&&b&&a) cnt++,c=0; if(b&&a) c=1,b=0; if(a) b=1; a=1; d=0; } if(m==3){ if(c) cnt++,c=0; if(b) c=1,b=0; if(a) b=1,a=0; d++; if(d==4) d=0,a=1; } } printf("%d",cnt); }

Compilation message (stderr)

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