HDU 2103 Family planning】的更多相关文章

http://acm.hdu.edu.cn/showproblem.php?pid=2103 Problem Description As far as we known,there are so many people in this world,expecially in china.But many people like LJ always insist on that more people more power.And he often says he will burn as mu…
Problem Description As far as we known,there are so many people in this world,expecially in china.But many people like LJ always insist on that more people more power.And he often says he will burn as much babies as he could.Unfortunatly,the presiden…
题目HDU 2103:http://acm.hdu.edu.cn/showproblem.php?pid=2103 Problem Description As far as we known,there are so many people in this world,expecially in china.But many people like LJ always insist on that more people more power.And he often says he will…
City Planning Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 483    Accepted Submission(s): 203 Problem Description After many years, the buildings in HDU has become very old. It need to rebuil…
City Planning Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 503    Accepted Submission(s): 213 Problem Description After many years, the buildings in HDU has become very old. It need to rebui…
Tourism Planning Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1051    Accepted Submission(s): 460 Problem Description Several friends are planning to take tourism during the next holiday. Th…
题目链接 题意 : n个月,每个月都至少需要mon[i]个人来工作,然后每次雇佣工人需要给一部分钱,每个人每个月还要给工资,如果解雇人还需要给一笔钱,所以问你主管应该怎么雇佣或解雇工人才能使总花销最小. 样例解释 : 3个月,雇佣一个工人需要4钱,每个工人每个月的工资是5钱,解雇一个工人需要6钱.然后这三个月每个月需要的工人数最少分别是10人9人11人.0结束输入 3 4 5 6 10 9 11 0 主管在一开始就招10个人并且第二个月不解雇,因为解雇比他工资贵,需要花费40+50+50 = 1…
Problem地址:http://acm.hdu.edu.cn/showproblem.php?pid=1158 一道dp题,或许是我对dp的理解的还不够,看了题解才做出来,要加油了. 只能先上代码了. #include <iostream> #include <cstring> #include <cstdio> using namespace std; const int MAXN = 100 + 28; int dp[15][MAXN]; int workers[…
传送门 Tourism Planning Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1115    Accepted Submission(s): 482 Problem Description Several friends are planning to take tourism during the next holiday.…
又一次看题解. 万事开头难,我想DP也是这样的. 呵呵,不过还是有进步的. 比如说我一开始也是打算用dp[i][j]表示第i个月份雇j个员工的最低花费,不过后面的思路就完全错了.. 不过这里还有个问题,这样开数组j开多大比较好,难道要我开2^31-1这么大? 题解里面开了1000多,也许再小一点也能过吧. 因为有可能解雇一个人的花费比较大,所以某个月可能继续雇佣他这样总的算来是最省的. 所以第i个月可能雇佣的人数是从num[i] ~ NumMax. 首先对第一个月的费用初始化,就是(雇佣+薪水)…