Submission #14103

#TimeUsernameProblemLanguageResultExecution timeMemory
14103minchurl볼질 (OJUZ10_ballparade)C++98
100 / 100
7 ms1084 KiB
#include<stdio.h> int base[5],dap,n; FILE *in; void b4(){ dap+=(base[1]==1 && base[2]==1)?base[3]:0; base[3]=(base[1]==1 && base[2]==1)?base[2]:base[3]; base[2]=(base[1]==1)?base[1]:base[2]; base[1]=1; } int main(){ int i,x,b; scanf("%d",&n); b=0; for(i=0;i<n;i++){ scanf("%d",&x); if(x==2){ b4(); b=0; }else if(x==1){ b++; if(b==4){ b4(); b=0; } }else{ b++; dap+=base[3]; base[3]=base[2]; base[2]=base[1]; base[1]=0; if(b==4){ base[1]=1; b=0; } } //printf("%d %d : %d : %d %d %d\n",b,dap,x,base[1],base[2],base[3]); } printf("%d\n",dap); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...