Submission #14090

#TimeUsernameProblemLanguageResultExecution timeMemory
14090ansol4328볼질 (OJUZ10_ballparade)C++98
100 / 100
7 ms1084 KiB
#include<stdio.h> int base[5]; int main() { int n, m, i, count=0, score=0; scanf("%d",&n); for(i=1 ; i<=n ; i++) { scanf("%d",&m); if(m==1 || m==3) count++; if(m==2) count=4; if(m==3) { base[0]=base[3]; base[3]=base[2]; base[2]=base[1]; base[1]=0; if(base[0]==1) base[0]=0, score++; } if(count==4) { if(base[1]==1 && base[2]==1 && base[3]==1) base[0]=1, base[3]=0; if(base[1]==1 && base[2]==1) base[3]=1, base[2]=0; if(base[1]==1) base[2]=1; base[1]=1; if(base[0]==1) base[0]=0, score++; count=0; } } printf("%d",score); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...