Bar Codes
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=31329#problem/N
#include<map>
#include<set>
#include<list>
#include<cmath>
#include<ctime>
#include<deque>
#include<stack>
#include<bitset>
#include<cstdio>
#include<vector>
#include<cstdlib>
#include<cstring>
#include<iomanip>
#include<numeric>
#include<sstream>
#include<utility>
#include<iostream>
#include<algorithm>
#include<functional> using namespace std ;
int n , k , m ;
const int maxn = 55 ;
long long f[ maxn ][ maxn ] ; int main()
{
while( scanf( "%d%d%d" , &n , &k , &m ) != EOF )
{
memset( f , 0 , sizeof( f ) ) ;
for( int i = 0 ; i <= n && i <= m ; ++i )
{
f[ 1 ][ i ] = 1 ;
}
for( int i = 2 ; i <= k ; ++i )
{
for( int j = i ; j <= n ; ++j )
{
for( int k = 1 ; k <= m && j - k > 0 ; ++k )
{
f[ i ][ j ] += f[ i - 1][ j - k ] ;
}
}
}
printf( "%lld\n" , f[ k ][ n ] ) ;
}
return 0 ;
}
Bar Codes的更多相关文章
- Bar codes in NetSuite Saved Searches(transport/reprint)
THIS IS A COPY FROM BLOG Ways of incorporating Bar Codes into your Netsuite Saved Searches. Code ...
- uva 10721 - Bar Codes(dp)
题目链接:uva 10721 - Bar Codes 题目大意:给出n,k和m,用k个1~m的数组成n,问有几种组成方法. 解题思路:简单dp,cnt[i][j]表示用i个数组成j, cnt[i][j ...
- LightOJ1191 Bar Codes(DP)
题目大概是,二进制数可以看作是由几段连续的0和连续的1组成,问:n位没有前导0的 且 共用k段连续0/1组成的 且 连续0/1个数不超过m的二进制数有多少个. 用dp[n][k][m]表示问题 dp[ ...
- DevExpress 2015.2发布 看看有哪些更新
下面是besy翻译的部分重要更新,要查看全部更新细节请访问英文官网. | 下载DevExpress 2015.2 Diagram Control 新的DevExpress Diagram Contro ...
- 【英文版本】Android开源项目分类汇总
Action Bars ActionBarSherlock Extended ActionBar FadingActionBar GlassActionBar v7 appcompat library ...
- UVA题目分类
题目 Volume 0. Getting Started 开始10055 - Hashmat the Brave Warrior 10071 - Back to High School Physics ...
- android github
Action Bars ActionBarSherlock Extended ActionBar FadingActionBar GlassActionBar v7 appcompat library ...
- Mobile Computing: the Next Decade论文 cloudlet薄云
1 Introduction “Information at your fingertips anywhere, anytime” has been the driving vision of mob ...
- ABAP--如何创建自定义打印条码
ABAP--如何创建自定义打印条码 BARCODE in Smartforms: How to create customize BARCODE for Smartforms. 1 Introduct ...
随机推荐
- 获得view所在的控制器
- (UIViewController*)getViewController{ for (UIView* next = [self superview]; next; next = next.supe ...
- Thread interrupt方法解析
初步理解 我们在看一些多线程代码的时候,有的时候会碰到使用interrupt()方法的时候.从字面的意思来理解,应该就是中断当前正在执行的线程.那么,对于一个我们设计的普通线程来说,如果我们在主线程里 ...
- E - Catch That Cow
Description Farmer John has been informed of the location of a fugitive cow and wants to catch her i ...
- floyed算法
Floyed算法(实际是动态规划问题) 问题:权值矩阵matrix[i][j]表示i到j的距离,如果没有路径则为无穷 求出权值矩阵中任意两点间的最短距离 分析:对于每一对定点u,v看是否存在一个点w使 ...
- HTML5 事件
下面的表格列出了可插入 HTML 5 元素中以定义事件行为的标准事件属性. Window 事件属性 - Window Event Attributes 表单事件 - Form Events 键盘事件 ...
- r语言之条件、循环语句
if条件语句:if (conditon) {expr1} else {expr2} > x<-1> if(x==1)+ {x<-"x=1"}else+ {x ...
- css基本框架
- 深入浅出—JAVA(8)
8.接口与抽象类 不是抽象的类就被称为具体类 不同继承树的类也可以实现相同的接口,类可以实现多个接口.
- GDKOI2016
天若有情天亦老 月若无恨月常圆 Day1 score cardcaptor AAAAAAAATT protal WWWWWWWWWW treasurehunt AAAAWXXXXX map AAATT ...
- strut2服务器与android交互数据
libs如图: web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app versio ...