主题链接:http://acm.hdu.edu.cn/showproblem.php? pid=4296 Buildings Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1822 Accepted Submission(s): 722 Problem Description Have you ever heard the st…
题意: 给定N个物体,每个物体有两个参数w,s. w代表它自身的重量: s代表它的强度.现在要把这些物体叠在一起,会产生一个PDV值. PDV解释:(Σwj)-si, where (Σwj) stands for sum of weight of all floors above.即为在i物体上方所有物体的重量和 - i的强度. 现在希望最大的PDV值最小.................... YY: 假设两个物体i,j,把谁放上面比较好? 假设把i放上面,则pdv1 = Wi - Sj:…
D - 淡黄的长裙 HDU - 4221(贪心) James is almost mad! Currently, he was assigned a lot of works to do, so many that you can't imagine. Each task costs Ai time as least, and the worst news is, he must do this work no later than time Bi! OMG, how could it be c…
证明转自: here 题意:有 n 个地板,每个地板 i 有两个权值 Wi, Si,且 PDV(i) = (ΣWj) - Si ( j 表示在 i 上面的地板).问如何调整顺序,使得[max(PDV)]最小. 思路:假设i,j相邻,并且i上面的重量为sum,若i在上面,则有pi=sum-si,pj=sum+wi-sj;若j在上面,则有pi'=sum+wj-si,pj'=sum-sj; 显然有pi<pi',pj>pj',于是令pj<pi',就有sum+wi-sj<sum+wj-s…
A - Hero Time Limit:3000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 4310 Description When playing DotA with god-like rivals and pig-like team members, you have to face an embarrassing situation: All your t…