Submission #19684

# Submission time Handle Problem Language Result Execution time Memory
19684 2016-02-25T04:32:00 Z willbelucky 괄호 (kriii4_R) C++
0 / 100
2000 ms 15792 KB
#include <iostream>
using namespace std;

int solve(int usedN, int N, int K)
{
	if (usedN > N)
		return 0;
	else if (usedN == N)
		return 1;
	return (solve(usedN + 1, N, K)+solve(usedN + 2, N, K))*K % 1000000007;
}

int main()
{
	for (int cases = 0; cases < 2; cases++)
	{
		int N, K;
		cin >> N >> K;
		cout << solve(0, N, K);
	}
}
# Verdict Execution time Memory Grader output
1 Execution timed out 2000 ms 15792 KB Program timed out
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -