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 ...
随机推荐
- python命令行解析工具argparse模块【2】
上一节,我们简要的介绍了argparse的用法,接下来几节,将详细讲解其中的参数及用法,这一节我们讲解ArgumentParser对象. argparse.ArgumentParser([descri ...
- UIView 设置阴影(属性说明)
以下代码实现: 第一个图片的代码 //加阴影--任海丽编辑 _imageView.layer.shadowColor = [UIColor blackColor].CGColor;//shadowCo ...
- 微信开放平台 获取 component_verify_ticket
<?php /** * @author zhaozhuobin * @date:2016-06=07 * */ namespace common\components;use DOMDocume ...
- vs2010中iostream.h出错
使用 #include <iostream> using namespace std; 替代 VS2010删除了所有非标准库,保留了C++标准库,iostream.h是以前旧版的库,VS2 ...
- C和指针---读书笔记。
C和指针---读书笔记.1,unsigned int 声明无符号int类型 默认是 singned,即此整数类型包括正负数.也可用于long上.说明符有 unsigned signed short ...
- 运行mvc报“无法确定存储版本;需要有效的存储连接或版本提示”
解决方法:删除数据库重建
- ASP.NET MVC3 Razor视图引擎-基础语法
I:ASP.NET MVC3在Visual Studio 2010中的变化 在VS2010中新建一个MVC3项目可以看出与以往的MVC2发生了很明显的变化. 1.ASP.NET MVC3必要的运行环境 ...
- CKEditor和CKFinder整合实现上传下载功能
CKEditor与CKFinder整合并实现文件上传功能 事先说明:此整合的是java版本号的, 用到的有:jsp + ckeditor + ckfinder (没有servlet 及其他框架技术) ...
- BZOJ AC300题留念
- 兼容性问题( css)
记录平时遇见的兼容性问题,有更好的解决办法希望各位提出,会持续更新 提出时间 问题描述 解决方案 2014/7/15 table下面使用img或者其他元素例如embed会产生,对应的空隙,假如使用文字 ...