作者DJWS (...)
看板ACMCLUB
标题Re: [问题] 10157
时间Mon Aug 1 15:58:22 2005
※ 引述《windows2k (KERORO军曹)》之铭言:
: ※ 引述《JonathanWang (尹儿)》之铭言:
: : 这样的 f[n][0] 里面会包含到深度不足 d 的答案
: 少打了一些东西
: 要求的解 为 (深度 <=d 的 f[n][0]) - (深度<=d-1 的f[n][0])
下面这段是别人给我的提示:
At each position, you have two choices: opening bracket and closing bracket.
So dp is table [depth][position] and stores how many ways there are to reach
that. And since you only want to allow maximum depth of d, don't allow bigger
depths when doing dp.
--
win2k的方法感觉比较容易写
王尹的方法实在很细腻.... :p
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 218.167.22.232