| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 30698 | okaybody10 | 볼질 (OJUZ10_ballparade) | C++98 | 9 ms | 1116 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#include <memory.h>
int main()
{
int N;
scanf("%d",&N);
bool base[5];
memset(base,0,sizeof(base));
int ballcnt=0,error=0;
for(int i=0;i<N;i++)
{
int throwb;
scanf("%d",&throwb);
if(throwb==1)
{
ballcnt+=1;
if(ballcnt==4)
{
if(base[1] && base[2] && base[3])
{
base[3]=false;
error+=1;
}
if(base[1] && base[2])
{
base[3]=true;
}
if(base[1])
base[2]=true;
base[1]=true;
ballcnt=0;
}
}
else if(throwb==2)
{
if(base[1] && base[2] && base[3])
{
base[3]=false;
error+=1;
}
if(base[1] && base[2])
{
base[3]=true;
}
if(base[1])
base[2]=true;
base[1]=true;
ballcnt=0;
}
else
{
ballcnt+=1;
if(base[3])
{
base[3]=false;
error+=1;
}
if(base[2])
{
base[3]=true;
base[2]=false;
}
if(base[1])
{
base[1]=false;
base[2]=true;
}
if(ballcnt==4)
{
base[1]=true;
ballcnt=0;
}
}
}
printf("%d",error);
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
