이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |