Submission #2204

# Submission time Handle Problem Language Result Execution time Memory
2204 2013-07-20T09:45:53 Z jwvg0425 생일수 II (GA4_birthday2) C++
0 / 100
1000 ms 1320 KB
#include<stdio.h>
int x,y;
int num[6];
int NumTo()
{
	int n=0,i,j=1;
	for(i=0;i<6;i++,j*=10)
	{
		n=n+j*num[i];
	}
	return n;
}
void add2(int idx)
{	
	if(num[idx]==8)
	{
		num[idx]=3;
		add2(idx+1);
	}
	else if(num[idx]==5)num[idx]=8;
	else if(num[idx]==3)num[idx]=5;
	else if(num[idx]==0)num[idx]=3;

}
void add()
{
	add2(0);
}

int main()
{
	int i=0,a,b=0,s=0;
	scanf("%d %d",&x,&y);
	a=x;
	for(;x;x/=10)
	{
		num[i++]=x%10;
	}
	i=0;
	for(;b!=y;)
	{
		add();
		b=NumTo();
		s=(s+a*b)%19980305;
		a=b;
	}
	printf("%d",s);
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 884 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 0 KB Program timed out
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 884 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1320 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 1320 KB Output isn't correct
2 Halted 0 ms 0 KB -