# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
14182 | gs14041 | 볼질 (OJUZ10_ballparade) | C++98 | 7 ms | 1084 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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)
{
ball=0;
if(a==1)
{
if(x[1] && x[2])
{
score+=x[3];
x[3]=0;
}
if(x[1])
{
if(x[2]) x[3]=1;
x[2]=1;
}
x[1]=1;
}
if(a==3)
{
score+=x[3];
x[3]=x[2];
x[2]=x[1];
x[1]=1;
}
}
else
{
if(a==3)
{
score+=x[3];
x[3]=x[2];
x[2]=x[1];
x[1]=0;
}
}
}
if(a==2)
{
ball=0;
if(x[1] && x[2])
{
score+=x[3];
x[3]=0;
}
if(x[1])
{
if(x[2]) x[3]=1;
x[2]=0;
}
x[2]=x[1];
x[1]=1;
}
//printf("%d %d %d %d %d %d\n",a,ball,x[1],x[2],x[3],score);
}
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... |