Submission #19855

# Submission time Handle Problem Language Result Execution time Memory
19855 2016-02-25T06:19:54 Z codingman 괄호 (kriii4_R) C++14
0 / 100
5 ms 9532 KB
#include <fstream>
#include <iostream>
#include <vector>
#include <math.h>
#include <algorithm>
#include <stack>
#include <string>
//#include <regex>
#include <map>
#include <numeric>
using namespace std;
vector<string> s;
//string c;
long long N, K;


long long dp[1000001] = {0,};
int main()
{
	cin >> N >> K;


	dp[0] = 1;
	dp[1] = 1;
	dp[2] = 2;
	long long mod = 1000000007;
	for(int i=3; i<=N; i++)
	{
		if(i % 2 == 0)
		{
			dp[i] = (dp[i / 2] % mod) + (dp[i - 1] % mod ) % mod;
		}
		else
		{
			dp[i] = (dp[i-1] % mod + 1 % mod) % mod;
		}
	}

	cout << dp[N] % mod;




	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 9532 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -