Submission #10253

# Submission time Handle Problem Language Result Execution time Memory
10253 2014-10-16T08:40:51 Z lavataste 팩토리얼 세제곱들의 합 (YDX14_fact) C
0 / 1
1000 ms 1084 KB
#include<stdio.h>
int GetFactorial(int n)
{
	int i, Factorial;
	Factorial=1;
	for(i=1; i<=n; i++) Factorial*=i;
	return Factorial;
}
int GetSquare(int Factorial, int k)
{
	int i;
	for(i=1; i<=k-1; i++) Factorial*=Factorial;
}

int main()
{
	int i,n, k;
	i=1;
	scanf("%d %d", &n, &k);
	int Factorial=GetFactorial(n);
	Factorial=GetSquare(Factorial, k);
	while(i)
	{
		if(Factorial%10!=0) {printf("%d", Factorial%10); i=0;}
	}
		return 0;
}
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 1084 KB Program timed out
2 Halted 0 ms 0 KB -