# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
19708 |
2016-02-25T04:49:02 Z |
joojis |
괄호 (kriii4_R) |
C++14 |
|
3 ms |
3944 KB |
#include <cstdio>
#include <vector>
#define MOD (1000000007)
int main ()
{
int N, K;
scanf("%d %d", &N, &K);
std::vector<long long unsigned> A(N+1, 0);
A[0] = 1;
A[1] = K;
for (int i=2; i<=N; i++) {
A[i] = ((A[i-1]*K)%MOD + (A[i-2]*K)%MOD) % MOD;
}
printf("%llu\n", A[N]);
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
3944 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |