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 run[4]={},sum,ball;
void runover()
{
if(run[3]==1)
sum++;
run[3]=run[2];
run[2]=run[1];
run[1]=0;
}
int main()
{
int n,t,i;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&t);
if(t==1)
{
ball++;
if(ball==4)
{
ball=0;
runover();
run[1]=1;
}
}
if(t==3)
{
ball++;
runover();
if(ball==4)
{
ball=0;
run[1]=1;
}
}
if(t==2)
{
ball=0;
runover();
run[1]=1;
}
}
printf("%d",sum);
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... |