# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
14181 | gs14041 | 볼질 (OJUZ10_ballparade) | C++98 | 7 ms | 1084 KiB |
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 main()
{
int score=0;
int x[4]={};
int n,i,j,a;
int ball=0;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d",&a);
if(a==1 || a==3)
{
ball++;
if(ball==4)
{
if(a==3)
{
score+=x[3];
x[3]=x[2];
x[2]=x[1];
x[1]=0;
}
else
{
if(x[1] && x[2])
{
x[3]=0;
score++;
}
if(x[1])
{
x[2]=0;
x[3]=1;
}
x[2]=x[1];
x[1]=1;
}
ball=0;
}
}
if(a==2)
{
ball=0;
if(x[1] && x[2])
{
x[3]=0;
score++;
}
if(x[1])
{
x[2]=0;
x[3]=1;
}
x[2]=x[1];
x[1]=1;
}
}
printf("%d",score);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |