結果

問題 No.44 DPなすごろく
ユーザー RCCWRCCW
提出日時 2017-02-14 21:51:01
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 317 bytes
コンパイル時間 582 ms
コンパイル使用メモリ 59,832 KB
実行使用メモリ 7,524 KB
最終ジャッジ日時 2023-08-28 17:00:04
合計ジャッジ時間 8,175 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 654 ms
4,376 KB
testcase_03 AC 38 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 156 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 4 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 155 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 10 ms
4,380 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>

using namespace std;
long long n;
long long cnt =0;

int dfs(int a){
	if(a>n){return 0;}
	if(a==n){cnt+=1; return 0;}
	dfs(a+2);
	//a=a-2;
	dfs(a+1);
	a=a-1;
	return cnt;
}

int main() {

	cin>>n;
	cout<<dfs(0)<<endl;
}
0