이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |