結果
問題 |
No.314 ケンケンパ
|
ユーザー |
|
提出日時 | 2015-12-07 00:17:01 |
言語 | Python2 (2.7.18) |
結果 |
RE
|
実行時間 | - |
コード長 | 314 bytes |
コンパイル時間 | 295 ms |
コンパイル使用メモリ | 6,944 KB |
実行使用メモリ | 99,712 KB |
最終ジャッジ日時 | 2024-09-14 16:59:43 |
合計ジャッジ時間 | 3,084 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 RE * 4 |
ソースコード
#!/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))