이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<stdio.h>
long long cache[1000000];
long long f(int x)
{
if(x==1||x==2)
{
cache[x] = 1;
return cache[x];
}
else
{
if(cache[x]==0){
cache[x] = f(x-1) + f(x-2);
return cache[x];
}
else
return cache[x];
}
}
void main()
{
int num,p,i;
long long sum = 1, test;
int arr[100] = {0,};
scanf("%d %d",&num,&p);
for(i=1;i<=num;i++)
sum *= f(i);
for(i=1;i<=p-1;i++){
test = sum;
while(1){
if(test%(i+1) == 0){
arr[i] += 1;
test = test/(i+1);
}
if(test%(i+1) != 0)
break;
}
}
for(i=1;i<=p-1;i++)
printf("%d\n",arr[i]);
//system("PAUSE");
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |