# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
19705 |
2016-02-25T04:44:58 Z |
willbelucky |
괄호 (kriii4_R) |
C++ |
|
5 ms |
1716 KB |
#include <iostream>
using namespace std;
int main()
{
for (int cases = 0; cases < 2; cases++)
{
int N, K;
cin >> N >> K;
int cache[4];
cache[0] = 1;
cache[1] = 1*K;
for (int iter = 2; iter < N+1; iter++)
{
cache[iter&3] = ((cache[(iter - 2)&3] + cache[(iter - 1)&3])*K % 1000000007);
}
cout << cache[N&3] << endl;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
1716 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |