Submission #15554

#TimeUsernameProblemLanguageResultExecution timeMemory
15554abcd123피보나미얼 (kriii3_V)C11
0 / 74
0 ms8892 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...