HDU 1494 题解(DP)】的更多相关文章

题面: 跑跑卡丁车 Problem Description 跑跑卡丁车是时下一款流行的网络休闲游戏,你可以在这虚拟的世界里体验驾驶的乐趣.这款游戏的特别之处是你可以通过漂移来获得一种 加速卡,用这种加速卡可以在有限的时间里提高你的速度.为了使问题简单化,我们假设一个赛道分为L段,并且给你通过每段赛道的普通耗时Ai和用加速卡的耗时Bi.加速卡的获得机制是:普通行驶的情况下,每通过1段赛道,可以获得20%的能量(N2O).能量集满后获得一个加速卡(同时能量清0).加速卡最多可以储存2个,也就是说当你…
题面: Fxx and game Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others) Total Submission(s): 2264 Accepted Submission(s): 600 Problem Description Young theoretical computer scientist Fxx designed a game for his students. In…
题目链接 题意 : 中文题不详述. 思路 : sum = L*N 段,每走过一段如果不用加速卡的话,能量会增20%,将20%看作1,也就是说每涨到15就要变为10,所以最多是14才不浪费. dp[i][j]代表第 i 段路需要能量是 j 的最少时间.状态转移方程是 //不用能量卡的时候 dp[i][j+1] = min(dp[i-1][j]+a[(i-1)%L],dp[i][j+1]) ;//用能量卡的时候,用完了之后能量卡减5 dp[i][j-5] = min(dp[i][j-5],dp[i-…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=3401 Trade Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) 问题描述 Recently, lxhgww is addicted to stock, he finds some regular patterns after a few days' study. He forecast…
B - Lawrence HDU - 2829 这个题目我觉得很难,难在这个dp方程不会写. 看了网上的题解,看了很久才理解这个dp转移方程 dp[i][j] 表示前面1~j 位并且以 j 结尾分成了 i 段的最小权值和 再定义一个数组 w[a,b] 表示 a到b 的权值和,注意这个不是前缀和,而是题目给的那种权值和 比如 a 到 b  是4 5 1 2 Its Strategic Value is 4*5 + 4*1 + 4*2 + 5*1 + 5*2 + 1*2 = 49. w[a,b]=4…
http://acm.hdu.edu.cn/showproblem.php? pid=4123 Problem Description Bob wants to hold a race to encourage people to do sports. He has got trouble in choosing the route. There are N houses and N - 1 roads in his village. Each road connects two houses,…
http://acm.hdu.edu.cn/showproblem.php?pid=4507 Problem Description 单身! 依旧单身! 吉哥依旧单身! DS级码农吉哥依旧单身! 所以.他生平最恨情人节,无论是214还是77.他都讨厌! 吉哥观察了214和77这两个数,发现: 2+1+4=7 7+7=7*2 77=7*11 终于,他发现原来这一切归根究竟都是由于和7有关!所以,他如今甚至讨厌一切和7有关的数. 什么样的数和7有关呢? 假设一个整数符合以下3个条件之中的一个.那么我…
http://acm.hdu.edu.cn/showproblem.php?pid=3709 Problem Description A balanced number is a non-negative integer that can be balanced if a pivot is placed at some digit. More specifically, imagine each digit as a box with weight indicated by the digit.…
XHXJ's LIS Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2265    Accepted Submission(s): 927 Problem Description #define xhxj (Xin Hang senior sister(学姐)) If you do not know xhxj, then careful…
You Are the One Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3348    Accepted Submission(s): 1524 Problem Description The TV shows such as You Are the One has been very popular. In order to m…