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<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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |