Submission #15206

# Submission time Handle Problem Language Result Execution time Memory
15206 2015-07-12T03:52:58 Z hunki 피보나미얼 (kriii3_V) C++
0 / 74
0 ms 1084 KB
#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
1 Correct 0 ms 1084 KB Output is correct
2 Incorrect 0 ms 1084 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -