Submission #15206

#TimeUsernameProblemLanguageResultExecution timeMemory
15206hunki피보나미얼 (kriii3_V)C++98
0 / 74
0 ms1084 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...