短小精悍的代码

dp[i][j] +=dp[k][j-1]*[i-k-1][j-1] i个结点 J层

 #include <iostream>
#include<cstdio>
#include<cstring>
#include<stdlib.h>
#include<algorithm>
using namespace std;
#define LL __int64
LL dp[][];
int main()
{
int i,j,k,n,d;
scanf("%d%d",&n,&d);
for(i = ; i <= n ; i++)
dp[][i] = ;
for(i = ; i <= n ; i++)
{
for(j = ; j <= n ; j++)
{
for(k = ; k < i ; k++)
dp[i][j]+=dp[k][j-]*dp[i-k-][j-];
}
}
printf("%I64d\n",dp[n][n]-dp[n][d-]);
return ;
}

Codeforces Beta Round #9 (Div. 2 Only)D的更多相关文章

  1. Codeforces Beta Round #80 (Div. 2 Only)【ABCD】

    Codeforces Beta Round #80 (Div. 2 Only) A Blackjack1 题意 一共52张扑克,A代表1或者11,2-10表示自己的数字,其他都表示10 现在你已经有一 ...

  2. Codeforces Beta Round #83 (Div. 1 Only)题解【ABCD】

    Codeforces Beta Round #83 (Div. 1 Only) A. Dorm Water Supply 题意 给你一个n点m边的图,保证每个点的入度和出度最多为1 如果这个点入度为0 ...

  3. Codeforces Beta Round #79 (Div. 2 Only)

    Codeforces Beta Round #79 (Div. 2 Only) http://codeforces.com/contest/102 A #include<bits/stdc++. ...

  4. Codeforces Beta Round #77 (Div. 2 Only)

    Codeforces Beta Round #77 (Div. 2 Only) http://codeforces.com/contest/96 A #include<bits/stdc++.h ...

  5. Codeforces Beta Round #76 (Div. 2 Only)

    Codeforces Beta Round #76 (Div. 2 Only) http://codeforces.com/contest/94 A #include<bits/stdc++.h ...

  6. Codeforces Beta Round #75 (Div. 2 Only)

    Codeforces Beta Round #75 (Div. 2 Only) http://codeforces.com/contest/92 A #include<iostream> ...

  7. Codeforces Beta Round #74 (Div. 2 Only)

    Codeforces Beta Round #74 (Div. 2 Only) http://codeforces.com/contest/90 A #include<iostream> ...

  8. Codeforces Beta Round #73 (Div. 2 Only)

    Codeforces Beta Round #73 (Div. 2 Only) http://codeforces.com/contest/88 A 模拟 #include<bits/stdc+ ...

  9. Codeforces Beta Round #72 (Div. 2 Only)

    Codeforces Beta Round #72 (Div. 2 Only) http://codeforces.com/contest/84 A #include<bits/stdc++.h ...

  10. Codeforces Beta Round #70 (Div. 2)

    Codeforces Beta Round #70 (Div. 2) http://codeforces.com/contest/78 A #include<bits/stdc++.h> ...

随机推荐

  1. cocos2d下,优秀骨骼spine的换装思路

    语文老师说,文章要有个好开头!!! 最近正在引入spine骨骼代替dragon bone骨骼,既然要替代,那么原先在dragon bone上的一些额外需求,不管dragon bone上能不能实现,都应 ...

  2. SNV ConnerStore使用说明

    1.  上传自己新建的文件新建的类文件 后面的 会有A标示要先 Add To Working copy 再点击提交 2. 上传第三方库时 默认SVN是忽略.a文件的要找到.a文件把他设置成不是忽略的通 ...

  3. python学习小结5:封装、继承、多态

    面向对象程序设计中的类有三大特性: 继承,封装,多态 继承:以普通的类为基础建立专门的类对象 封装:对外部世界隐藏对象的工作细节 多态:可对不同类的对象使用同样的操作 在Python中类的继承定义基本 ...

  4. C# WPF打印报表

    前天我的一个同学由于打印报表而苦恼,所以就介绍了一下WPF的打印报表,希望能帮助到大家. 展示报表 1. 首先新建项“报表”,选定项目,右击,点击“添加”->“新建项”->“报表”

  5. android中设置Animation 动画效果

    在 Android 中, Animation 动画效果的实现可以通过两种方式进行实现,一种是 tweened animation 渐变动画,另一种是 frame by frame animation ...

  6. Codeforces Round #348 (VK Cup 2016 Round 2, Div. 2 Edition) D. Little Artem and Dance

    题目链接: http://codeforces.com/contest/669/problem/D 题意: 给你一个初始序列:1,2,3,...,n. 现在有两种操作: 1.循环左移,循环右移. 2. ...

  7. 修改tomcat 启动45秒

    当我们需要增加Tomcat的启动时间,修改方法如下:

  8. PHP开发框架[国内框架]

    1.Thinkphp  http://thinkphp.cn/ 2.Brophp   http://www.brophp.com/zf/ 由LAMP兄弟连打造 3.WindFramework http ...

  9. Filter及FilterChain的使用详解(转)

    一.Filter的介绍及使用 什么是过滤器? 与Servlet相似,过滤器是一些web应用程序组件,可以绑定到一个web应用程序中.但是与其他web应用程序组件不同的是,过滤器是"链&quo ...

  10. uva 11489

    简单博弈 #include <cstdio> #include <cstdlib> #include <cmath> #include <map> #i ...