This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<cstdio>
int i,b[4],c,n,t,s;
main()
{
scanf("%d",&n);
for(;i<n;i++) {
scanf("%d",&t);
if(t==1)c++;
if(t==3) {
c++;
s+=b[3];
b[3]=b[2];
b[2]=b[1];
b[1]=0;
}
if(c==4 || t==2) {
if(b[1]==1) {
if(b[2]==1) {
if(b[3]==1)s++;
b[3]=1;
}
b[2]=1;
}
b[1]=1;
c=0;
}
}
printf("%d",s);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |