This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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... |