- 选课
- 2012-09-10 20:45:22 @
#include
#include
using namespace std;
int N, M, par, v[500], f[500][500];
struct Binary_Tree
{
int l, r, last;
}Tree[500];
int dp(int u, int m)
{
if (!u) return 0;
if (f[m]) return f[m];
f[m] = dp(Tree.r, m);
for (int k = 0; k < m; ++k)
f[m] = max(f[m], dp(Tree.l, k) + dp(Tree.r, m - k - 1) + v);
return f[m];
}
int main()
{
scanf("%d%d", &N, &M);
for (int i = 1; i
0 条评论
目前还没有评论...