Submission #19847

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

int main(){
    long long n,k;
    scanf("%lld%lld",&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]%je);
}
# 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 -