Submission #14031

#TimeUsernameProblemLanguageResultExecution timeMemory
14031baneling100볼질 (OJUZ10_ballparade)C++98
100 / 100
7 ms1084 KiB
#include <stdio.h> int N, One, Two, Three, Ball, Score; int main(void) { int i, num; scanf("%d",&N); for(i=1 ; i<=N ; i++) { scanf("%d",&num); if(num==1) Ball++; if(num==3) { Ball++; if(Three) { Three=0; Score++; } if(Two) { Two=0; Three=1; } if(One) { One=0; Two=1; } } if(num==2 || Ball==4) { Ball=0; if(One && Two && Three) { Three=0; Score++; } if(One && Two) { Two=0; Three=1; } if(One) { One=0; Two=1; } One=1; } } printf("%d",Score); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...