HDU - 1723 - Distribute Message
先上题目:
Distribute Message
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1186 Accepted Submission(s): 547
When N=0 and M=0, terminates the input and this test case is not to be processed.
4 1 : A->B->C->D
#include <cstdio>
#include <cstring>
#define MAX 32
#define LL long long
using namespace std; LL dp[MAX]; int main()
{
int n,m;
while(scanf("%d %d",&n,&m),(n+m)){
memset(dp,,sizeof(dp));
dp[]=;
for(int i=;i<=n;i++){
for(int j=;j<=m && i+j<=n;j++){
dp[i+j]+=dp[i];
}
}
printf("%I64d\n",dp[n]);
}
return ;
}
1723
HDU - 1723 - Distribute Message的更多相关文章
- HDU 1723 Distribute Message DP
The contest’s message distribution is a big thing in prepare. Assuming N students stand in a row, fr ...
- hdu 1509 Windows Message Queue
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=1509 Windows Message Queue Description Message queue ...
- HDU 1509 Windows Message Queue(队列)
题目链接 Problem Description Message queue is the basic fundamental of windows system. For each process, ...
- hdu 1509 Windows Message Queue (优先队列)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1509 题目大意:每一次输入都有序号和优先级,优先级小的先输出,优先级相同的话则序号小的先输出!第一次用 ...
- hdu 1509 Windows Message Queue (优先队列)
Windows Message QueueTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Oth ...
- hdu 1723 DP/递推
题意:有一队人(人数 ≥ 1),开头一个人要将消息传到末尾一个人那里,规定每次最多可以向后传n个人,问共有多少种传达方式. 这道题我刚拿到手没有想过 DP ,我觉得这样传消息其实很像 Fibonacc ...
- HDU题解索引
HDU 1000 A + B Problem I/O HDU 1001 Sum Problem 数学 HDU 1002 A + B Problem II 高精度加法 HDU 1003 Maxsu ...
- mybatis中的resultMap与resultType、parameterMap与 parameterType的区别
Map:映射:Type:Java类型 resultMap 与 resultType.parameterMap 与 parameterType的区别在面试的时候被问到的几率非常高,项目中出现了一个小b ...
- AMQP 0-9-1 Model Explained Why does the queue memory grow and shrink when publishing/consuming? AMQP和AMQP Protocol的是整体和部分的关系 RabbitMQ speaks multiple protocols.
AMQP 0-9-1 Model Explained — RabbitMQ http://next.rabbitmq.com/tutorials/amqp-concepts.html AMQP 0-9 ...
随机推荐
- golang LMDB入门例子——尼玛,LMDB的文档真的是太少了
使用的是这个库:https://github.com/szferi/gomdb 安装: go get github.com/szferi/gomdb 代码: package main import ( ...
- 复习--二叉树&&树
树是一种很常用的数据结构,日后的学习中会经常碰到运用树的知识. //构造二叉树#include<cstdio> #include<iostream> #include<a ...
- PCB Genesis加邮票孔(线与弧)实现算法
一.Genesis加邮票孔(线与弧)实现算法 1.鼠标点击位置P点(可以确认搜索区域位置,确认点击位置周边元素分区,此所讲算法未应用到P点坐标) 2.求出:P1C与P2C (线与弧最近点距离的2个点) ...
- thinkphp session db配置
这篇文章主要介绍了ThinkPHP实现将SESSION存入MYSQL的方法,需要的朋友可以参考下 本文以实例讲解了ThinkPHP实现将SESSION存入MYSQL的方法,所采用的运行环境是Thi ...
- go之数据类型转换和类型断言
一.类型转换 1.1 简单类型转换 格式 valueOfTypeB = typeB(valueOfTypeA) int 转 float64 package main import "fmt& ...
- TCP/IP详解(三)
超时与重传: TCP在发送一个包时,启动一个定时器,如果在定时器溢出之前没有收到ACK,则认为发出的包丢失了,此时会重传丢失的包.这就是超时重传. 其中定时器的时间不是一个固定值,它是根据RTT计算的 ...
- shell 实用命令学习
查找文件 -iname 大小写不敏感 “*.log” .log后缀的文件 -type d 文件类型为目录的 find ./ -name 'index.html' 查找当前目录,及其子目录下文件
- C#之纯数字判断
public bool isNaN(string temp) { ; i <temp.Length; i++) { byte tempByte = Convert.ToByte(temp[i]) ...
- Obsolete---标记方法 类过期
最近做一个接口的修改,由于是很老的接口,不太了解外部有多少地方引用了它. 但是内部的方法由于业务发展已经不太适合现在的需求,想改又不该动.所以想到了如果设置为过期. Obsolete 属性将某个程序实 ...
- Visual C++ 6.0的界面介绍
双击Visual C++ 6.0安装目录下的文件启动Visual C++ 6.0,通过“文件”→“新建”可新建一个Win32 Console Application项目.创建好项目后,显示Visu ...