Submission #19813

# Submission time Handle Problem Language Result Execution time Memory
19813 2016-02-25T05:52:35 Z jihoon 괄호 (kriii4_R) C++
0 / 100
6 ms 16708 KB
#include<cstdio>
#define je 1000000007
long long fibo[2000001];

int main(){
    int n,k;
    long long now=1,r,c,ans=0;
    scanf("%d %d",&n,&k);
    fibo[0]=1;fibo[1]=k;
    for(int i=2;i<=n;i++){
        fibo[i]=fibo[i-2];
        fibo[i]+=fibo[i-1];
        fibo[i]%=je;
        fibo[i]*=k;
        fibo[i]%=je;
    }
    printf("%lld\n",fibo[n]);
}
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 16708 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -