답안 #14105

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
14105 2015-05-02T05:45:41 Z ggoh 볼질 (OJUZ10_ballparade) C++
22 / 100
7 ms 1084 KB
#include<cstdio>
#include<algorithm>
#include<vector>
#include<queue>
#include<cstring>
int p,x,s,i,j,b,a[4];
void f(int k)
{
	if(k==4)s++;
	else
	{
		if(a[k])f(k+1);
		else a[k]=1;
	}
}
main()
{
	scanf("%d",&p);
	for(i=0;i<p;i++)
	{
		scanf("%d",&x);
		if(x==1)
		{
			b++;
			if(b==4)f(1),b=0;
		}
		else if(x==2)
		{
			f(1),b=0;
		}
		else
		{
			for(j=3;j>=1;j--)
			{
				if(a[j])
				{
					if(j==3)s++;
					else
					{
						a[j]=0;
						a[j+1]=1;
					}
				}
			}
			if(b==4)f(1),b=0;
		}
	}
	printf("%d",s);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1084 KB Output is correct
2 Correct 3 ms 1084 KB Output is correct
3 Correct 0 ms 1084 KB Output is correct
4 Correct 0 ms 1084 KB Output is correct
5 Correct 3 ms 1084 KB Output is correct
6 Correct 0 ms 1084 KB Output is correct
7 Correct 0 ms 1084 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 1084 KB Output isn't correct
2 Incorrect 0 ms 1084 KB Output isn't correct
3 Incorrect 0 ms 1084 KB Output isn't correct
4 Incorrect 0 ms 1084 KB Output isn't correct
5 Incorrect 0 ms 1084 KB Output isn't correct
6 Incorrect 0 ms 1084 KB Output isn't correct
7 Incorrect 3 ms 1084 KB Output isn't correct
8 Correct 0 ms 1084 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 7 ms 1084 KB Output isn't correct
2 Incorrect 6 ms 1084 KB Output isn't correct
3 Incorrect 6 ms 1084 KB Output isn't correct
4 Incorrect 0 ms 1084 KB Output isn't correct
5 Incorrect 3 ms 1084 KB Output isn't correct
6 Incorrect 6 ms 1084 KB Output isn't correct
7 Incorrect 6 ms 1084 KB Output isn't correct
8 Incorrect 6 ms 1084 KB Output isn't correct
9 Incorrect 0 ms 1084 KB Output isn't correct
10 Correct 0 ms 1084 KB Output is correct
11 Correct 0 ms 1084 KB Output is correct
12 Incorrect 0 ms 1084 KB Output isn't correct
13 Incorrect 0 ms 1084 KB Output isn't correct
14 Incorrect 3 ms 1084 KB Output isn't correct
15 Correct 0 ms 1084 KB Output is correct