标题:求此题解解题思路最有附加代码
取消只看楼主
草狼
Rank: 9Rank: 9Rank: 9
等 级:蜘蛛侠
威 望:2
帖 子:577
专家分:1040
注 册:2010-4-6
结帖率:94.44%
已结贴  问题点数:5 回复次数:9 
求此题解解题思路最有附加代码
求大牛们帮我看看这题应该怎么来解啊?解这样类型的题目思路应该怎么来考虑啊???


Problem Description:
A project manager wants to determine the number of the workers needed in every month. He does know the minimal number of the workers needed in each month. When he hires or fires a worker, there will be some extra cost. Once a worker is hired, he will get the salary even if he is not working. The manager knows the costs of hiring a worker, firing a worker, and the salary of a worker. Then the manager will confront such a problem: how many workers he will hire or fire each month in order to keep the lowest total cost of the project.

Input:
The input may contain several data sets. Each data set contains three lines. First line contains the months of the project planed to use which is no more than 12. The second line contains the cost of hiring a worker, the amount of the salary, the cost of firing a worker. The third line contains several numbers, which represent the minimal number of the workers needed each month. The input is terminated by line containing a single '0'.

Output:
The output contains one line. The minimal total cost of the project.

Sample Input:
3
4 5 6
10 9 11
0
Sample Output
199
搜索更多相关主题的帖子: 思路 题解 解题 代码 
2010-04-10 09:28
草狼
Rank: 9Rank: 9Rank: 9
等 级:蜘蛛侠
威 望:2
帖 子:577
专家分:1040
注 册:2010-4-6
得分:0 
回复 4楼 寒风中的细雨
这叫白说 几个月的人数都要连续考虑的
2010-04-10 19:49
草狼
Rank: 9Rank: 9Rank: 9
等 级:蜘蛛侠
威 望:2
帖 子:577
专家分:1040
注 册:2010-4-6
得分:0 
回复 3楼 玩出来的代码
错了
2010-04-10 19:50
草狼
Rank: 9Rank: 9Rank: 9
等 级:蜘蛛侠
威 望:2
帖 子:577
专家分:1040
注 册:2010-4-6
得分:0 
回复 7楼 玩出来的代码
感觉有点。。。。。
2010-04-10 21:37
草狼
Rank: 9Rank: 9Rank: 9
等 级:蜘蛛侠
威 望:2
帖 子:577
专家分:1040
注 册:2010-4-6
得分:0 
回复 10楼 Devil_W
c++代码不可以  别且我在VC6.0下面编译错误了- -!  个人感觉你的思想跟前一个给代码的人一样的你测试下这组数据对不对:
4
4 3 6
12 10 9 11;看答案是多少;
2010-04-11 06:33
草狼
Rank: 9Rank: 9Rank: 9
等 级:蜘蛛侠
威 望:2
帖 子:577
专家分:1040
注 册:2010-4-6
得分:0 
回复 17楼 Devil_W
http://acm.hdu.
密码:lionelzhang;
AC掉给我说下
2010-04-11 16:32
草狼
Rank: 9Rank: 9Rank: 9
等 级:蜘蛛侠
威 望:2
帖 子:577
专家分:1040
注 册:2010-4-6
得分:0 
还有 我发帖子是叫你们帮我解题目的,不是让你们开战的啊 不服就去比比么  看谁先吧这12到DP题目鸟掉
http://acm.hdu.
密码:lionelzhang;
2010-04-11 17:06
草狼
Rank: 9Rank: 9Rank: 9
等 级:蜘蛛侠
威 望:2
帖 子:577
专家分:1040
注 册:2010-4-6
得分:0 
回复 31楼 zglieren303
不是  不过我们都在做杭电的题目,大家可以都去做啊   一起学习啊
2010-04-11 21:56
草狼
Rank: 9Rank: 9Rank: 9
等 级:蜘蛛侠
威 望:2
帖 子:577
专家分:1040
注 册:2010-4-6
得分:0 
回复 30楼 Devil_W
这不是水题好不,DP题目中算难的了, 貌似你很牛  看你12到用多少时间鸟掉啊 都鸟掉了记得把解题思路跟我说说啊 ,谢谢啦
2010-04-11 21:58
草狼
Rank: 9Rank: 9Rank: 9
等 级:蜘蛛侠
威 望:2
帖 子:577
专家分:1040
注 册:2010-4-6
得分:0 
回复 36楼 Devil_W
厉害啊,呵呵。求代码和解题思路 对了 你是用C++写的哦 那就求思路吧

快去把1004 AC了啊
2010-04-12 17:26



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-302397-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.043140 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved