結果

問題 No.314 ケンケンパ
ユーザー cielciel
提出日時 2015-12-07 00:17:01
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 314 bytes
コンパイル時間 841 ms
コンパイル使用メモリ 6,732 KB
実行使用メモリ 97,704 KB
最終ジャッジ日時 2023-10-12 18:31:53
合計ジャッジ時間 3,659 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 11 ms
5,864 KB
testcase_02 AC 11 ms
5,992 KB
testcase_03 AC 11 ms
6,088 KB
testcase_04 AC 11 ms
5,884 KB
testcase_05 AC 11 ms
5,868 KB
testcase_06 AC 11 ms
5,936 KB
testcase_07 AC 11 ms
6,024 KB
testcase_08 AC 11 ms
5,896 KB
testcase_09 AC 11 ms
5,936 KB
testcase_10 AC 13 ms
6,132 KB
testcase_11 AC 13 ms
6,428 KB
testcase_12 AC 15 ms
6,588 KB
testcase_13 AC 16 ms
6,800 KB
testcase_14 AC 37 ms
11,860 KB
testcase_15 AC 60 ms
18,896 KB
testcase_16 AC 136 ms
32,996 KB
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python
import sys
if sys.version_info[0]>=3: raw_input=input
sys.setrecursionlimit(100000)

memo={}
def dfs(k,p,d):
	if k<0 or p<0: return 0
	if d==0: return 1
	x=tuple([k,p,d])
	if x not in memo:
		memo[x]=(dfs(k-1,1,d-1)+dfs(2,p-1,d-1))%1000000007
	return memo[x]

n=int(raw_input())
print(dfs(2,0,n))
0