Submission #19865

# Submission time Handle Problem Language Result Execution time Memory
19865 2016-02-25T06:22:52 Z ilbbke 괄호 (kriii4_R) C++
0 / 100
5 ms 8896 KB
#include<stdio.h>

long long D[1000003];

int main()
{
    int n,k;
    scanf("%d%d",&n,&k);
    D[0]=1, D[1]=k;
    for(int i=2; i<=n; i++){
        D[i]=((D[i-1]+D[i-2])*k)%1000000007;
        if(i&1) D[i]=((D[i]+D[i/2])*k)%1000000007;
    }
    printf("%lld\n",D[n]);
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 8896 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -