poj 2193 Lenny's Lucky Lotto Lists
来源:互联网 发布:如果二战中国投降知乎 编辑:程序博客网 时间:2024/06/05 15:57
题目链接:http://poj.org/problem?id=2193
题目思路:转移方程:dp[i][j]=sum[i-1][j/2]; sum[i][j]=sum[i][j-1]+dp[i][j];其中dp[i][j]记录的是前i个数结尾是j的个数,而sum是小于等于j;
#include<stdio.h>#include<stdlib.h>#include<string.h>#include<string>#include<queue>#include<algorithm>#include<vector>#include<stack>#include<list>#include<iostream>#include<map>using namespace std;#define inf 0x3f3f3f3f#define Max 110int max(int a,int b){return a>b?a:b;}int min(int a,int b){return a<b?a:b;}int t,n,m;__int64 dp[12][2010],sum[12][2010];int main(){ int i,j,k,count=1; //dp[0][0]=1; for(i=1;i<=10;i++) for(j=1;j<=2000;j++) { if(i==1) dp[i][j]=1; else dp[i][j]=sum[i-1][j/2]; sum[i][j]=sum[i][j-1]+dp[i][j]; } scanf("%d",&t); while(t--) { scanf("%d%d",&n,&m); __int64 ans=0; printf("Case %d: n = %d, m = %d, # lists = %I64d\n",count++,n,m,sum[n][m]); }}
- poj 2193 Lenny's Lucky Lotto Lists
- POJ 2193 Lenny's Lucky Lotto Lists
- POJ 2193 Lenny's Lucky Lotto Lists(简单二维dp)
- poj 2193 Lenny's Lucky Lotto Lists 简单dp
- pku2193 Lenny's Lucky Lotto Lists
- zoj 2402 - Lenny's Lucky Lotto Lists
- zoj 2402 Lenny's Lucky Lotto Lists
- ZOJ 2402 Lenny's Lucky Lotto Lists(简单DP)
- 1011. Lenny's Lucky Lotto
- Scily 1011. Lenny's Lucky Lotto
- Sicily 1011 Lenny's Lucky Lotto
- [sicily online]1011. Lenny's Lucky Lotto
- Scily 1011. Lenny's Lucky Lotto
- sicily 1011. Lenny's Lucky Lotto
- Sicily 1011. Lenny's Lucky Lotto
- Sicily 1011.Lenny's Lucky Lotto
- Sicily 1011. Lenny's Lucky Lotto
- sicily 1011. Lenny's Lucky Lotto
- eclipse中build没有apk输出
- Latex文档中算法的编辑和visio图的插入
- Geometry Shader 概念和实例
- Struts2,spring,hibernate高效开发的最佳实践
- Linux 上下文切换分析笔记 (MIPS)
- poj 2193 Lenny's Lucky Lotto Lists
- 从一生的角度看程序员的学习和发展
- Tomcat 线程池
- linux nfs服务配置
- win7 访问共享文件夹时遇到不同步问题
- 批处理文件的语法及应用
- 全局变量$_SESSION的使用
- 07---jsp标签编程01(认识标签)
- 浮点shuffle