結果

問題 No.314 ケンケンパ
ユーザー cielciel
提出日時 2015-12-07 00:15:16
言語 PyPy2
(7.3.15)
結果
TLE  
実行時間 -
コード長 314 bytes
コンパイル時間 1,774 ms
コンパイル使用メモリ 77,484 KB
実行使用メモリ 263,480 KB
最終ジャッジ日時 2023-10-12 18:24:01
合計ジャッジ時間 10,928 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 73 ms
76,268 KB
testcase_02 AC 72 ms
76,260 KB
testcase_03 AC 75 ms
76,920 KB
testcase_04 AC 73 ms
76,536 KB
testcase_05 AC 73 ms
76,236 KB
testcase_06 AC 72 ms
76,324 KB
testcase_07 AC 72 ms
76,676 KB
testcase_08 AC 74 ms
76,852 KB
testcase_09 AC 73 ms
76,652 KB
testcase_10 AC 90 ms
79,524 KB
testcase_11 AC 90 ms
79,544 KB
testcase_12 AC 97 ms
79,784 KB
testcase_13 AC 101 ms
79,904 KB
testcase_14 AC 143 ms
88,084 KB
testcase_15 AC 187 ms
96,288 KB
testcase_16 AC 342 ms
120,680 KB
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
権限があれば一括ダウンロードができます

ソースコード

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