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>
int main ()
{
int n, p;
scanf("%d %d", &n, &p);
long long f[3];
long long r[1004] = {0, };
long long ans[1004] = {0,};
for(int i=0; i<1004; i++) r[i] = 1;
f[0] = 0;
f[1] = 1;
for(int i=2; i<=n; i++) {
f[2] = f[0] + f[1];
for(int j=2; j<=p; j++) {
r[j] *= f[2];
while((r[j] % j) == 0) {
ans[j]++;
r[j] /= j;
}
}
f[0] = f[1];
f[1] = f[2];
}
for(int j=2; j<=p; j++) {
printf("%lld\n", ans[j]);
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |