HDU ACM 3177 Crixalis's Equipment】的更多相关文章

Crixalis's Equipment Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2001    Accepted Submission(s): 805 [解题思路]这题只能说盛爷威武!盛爷给我们将贪心的时候将这题拿出来了,主要说说这题的思路,拿出两个装备,ai, bi, aj, bj, 假设两件装备都能放进去,那么先放置i后放置…
Crixalis's Equipment Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2795    Accepted Submission(s): 1141 Problem Description Crixalis - Sand King used to be a giant scorpion(蝎子) in the deserts…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3177 \(describe\): 有一个山洞,山洞的容积最大为\(v\).现在你有\(n\)个物品,这些物品在往山洞里搬和放在山洞所需要占用山洞的体积是两个不同的值\(B\),\(A\).你可以理解为在搬运这个物品进洞时需要的容积为一个\(B\),放下物品后的容积是一个\(A\).在任何时刻搬运物品都不允许超过山洞的最大容积.试求能不能把所有物品搬进去 题解: 这个题正解是贪心...没错... 题目…
题意:判断 n 件物品是否可以搬进洞里,每件物品有实际体积A和移动时的额外体积 B . 析:第一反应就是贪心,一想是不是按B从大到小,然后一想,不对,比如体积是20,第一个 是A=11, B=19.第二个是A = 1,B = 18.很明显不对. 我们取AB的差值,进行贪心,为什么呢? 我反过来想一下,假设我们把两个物品搬到洞中,所需要的洞的最小体积.第一个,A = 2,B = 10. 第二个,A = 5, B = 10.如果先放第一个,第放第二个,体积为12,如果反过来则是15,很明显是先放 差…
  #include "stdio.h" #include "stdlib.h" /* 贪心算法: Ai->x 表示第i个物品的体积 Ai->y 表示第i个物品移动所需要的空间大小 前提:所有物品的移动空间都不大于容积V Ai->x + A(i+1)->y 表示先移动第一个物品 再移动第二个物品所需要的瞬时最大空间大小 for example : V = 10 x y 2 10 8 5 2+5 < 8+10 所以第一个物品先搬动 */…
http://acm.hdu.edu.cn/showproblem.php? pid=3177 Crixalis's Equipment Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2562    Accepted Submission(s): 1056 Problem Description Crixalis - Sand Kin…
Crixalis's Equipment Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2562    Accepted Submission(s): 1056 Problem Description Crixalis - Sand King used to be a giant scorpion(蝎子) in the deserts…
Crixalis's Equipment Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1854    Accepted Submission(s): 770 Problem Description Crixalis - Sand King used to be a giant scorpion(蝎子) in the deserts o…
Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 11810    Accepted Submission(s): 8362 Problem Description "Well, it seems the first problem is too easy. I will let…
Crixalis's Equipment Problem Description Crixalis - Sand King used to be a giant scorpion(蝎子) in the deserts of Kalimdor. Though he's a guardian of Lich King now, he keeps the living habit of a scorpion like living underground and digging holes. Some…