Submission #14598

#TimeUsernameProblemLanguageResultExecution timeMemory
14598DimiHDKunho0415볼질 (OJUZ10_ballparade)C11
100 / 100
7 ms1084 KiB
#include<stdio.h> int R[5]; int main(){ int N, i, j, Ball=0, a; scanf("%d", &N); for(i=1; i<=N; i++){ scanf("%d", &a); if(a==1) Ball++; if(a==3){ Ball++; for(j=3; j>=1; j--){ if(R[j]) R[j+1]++; R[j]=0; } } if(a==2 || Ball==4){ Ball=0; if(R[1]==1 && R[2]==1 && R[3]==1) R[4]++; else if(R[1]==1 && R[2]==1) R[3]=1; else if(R[1]==1) R[2]=1; else R[1]=1; } } printf("%d", R[4]); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...