饮料最大满意度订购问题1.6.2
来源:互联网 发布:怎样上google 知乎 编辑:程序博客网 时间:2024/04/29 07:52
#include <stdio.h>
#include <iostream>
int h[5]={15,10,1,1,1};
int r[5]={1,2,3,2,1};
int c[5]={6,3,2,3,6};
int opt[7][6];
int cal(int v,int type)
{
if (type==5)
{
if (v==0)
return 0;
else
return -10000;
}
else if (v<0)
return -10000;
else if (v==0)
return 0;
else if (opt[v][type]!=-1)
return opt[v][type];
int max=-10000;
for (int j=0;j<=c[type];j++)
{
int x=cal(v-j*r[type],type+1);
if (x!=-10000)
{
x+=h[type]*j;
if (x>max)
{
max=x;
}
}
}
opt[v][type]=max;
return opt[v][type];
}
void main()
{
for (int m=0;m<7;m++)
for (int n=0;n<6;n++)
opt[m][n]=-1;
int z=cal(6,0);
printf("%d",z);
}
- 饮料最大满意度订购问题1.6.2
- 饮料最大满意度算法1.6.1
- 关于用户满意度问题的设置
- 饮料供货问题
- 啤酒和饮料 问题
- 瓶盖换饮料问题
- 喝饮料问题
- 小学奥数题--饮料问题
- (转)网站满意度
- 工作满意度
- 满意度调查解决方案
- 消费者满意度调查
- 顾客满意度
- CSI,用户满意度
- 满意度调查全过程
- 满意
- 1.6节:饮料供货
- 1.6 饮料供货
- hibernate错误:ORA-01461: can bind a LONG value only for insert into a LONG column
- 学历
- Rational Test RealTime 测试操作小结
- 我设计的一个线程池
- PNG文件格式详解
- 饮料最大满意度订购问题1.6.2
- 温故知新 javascript 正则表达式
- 在VC中使用Flash
- 海量数据库的查询优化及分页算法方案
- SQL2005 XML 的例子
- javascript打印服务器端PDF
- SQLite 简单教程
- .NET垃圾回收机制详解与心得体会
- 日記-01-2008.08.06-15:44