HDU2124 Repair the Wall(贪心)】的更多相关文章

Problem Description Long time ago , Kitty lived in a small village. The air was fresh and the scenery was very beautiful. The only thing that troubled her is the typhoon. When the typhoon came, everything is terrible. It kept blowing and raining for…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2124 Ac code : #include<stdio.h> #include<stdlib.h> int cmp(const void *a,const void *b) { return *(int *)b-*(int *)a; } int main() { int L, N, i; int a[601], sum, len; while(scanf("%d",…
Repair the Wall http://acm.hdu.edu.cn/showproblem.php?pid=2124 Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6833    Accepted Submission(s): 3174 Problem Description Long time ago , Kitty live…
Long time ago , Kitty lived in a small village. The air was fresh and the scenery was very beautiful. The only thing that troubled her is the typhoon. When the typhoon came, everything is terrible. It kept blowing and raining for a long time. And wha…
Description Long time ago , Kitty lived in a small village. The air was fresh and the scenery was very beautiful. The only thing that troubled her is the typhoon. When the typhoon came, everything is terrible. It kept blowing and raining for a long t…
问题 : Repair the Wall 时间限制: 1 Sec  内存限制: 128 MB 题目描述 Long time ago , Kitty lived in a small village. The air was fresh and the scenery was very beautiful. The only thing that troubled her is the typhoon. When the typhoon came, everything is terrible.…
http://acm.hdu.edu.cn/showproblem.php?pid=2124 Problem Description Long time ago , Kitty lived in a small village. The air was fresh and the scenery was very beautiful. The only thing that troubled her is the typhoon. When the typhoon came, everythin…
倒过来看 , 每次总是选择最短的两块木板合并 , 用heap维护 ------------------------------------------------------------------------------ #include<cstdio> #include<cstring> #include<algorithm> #include<iostream> #include<queue>   #define rep( i , n )…
Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,000) planks of wood, each having some integer length Li (1 ≤ Li ≤ 50,000) units. He then purchases a single long b…
Description Farmer John想修理牧场栅栏的某些小段.为此,他需要N(1<=N<=20,000)块特定长度的木板,第i块木板的长度为Li(1<=Li<=50,000).然后,FJ去买了一块很长的木板,它的长度正好等于所有需要的木板的长度和.接下来的工作,当然是把它锯成需要的长度.FJ忽略所有切割时的损失——你也应当忽略它. FJ郁闷地发现,他并没有锯子来把这块长木板锯开.于是他把这块长木板带到了Farmer Don的农场,想向FD借用锯子. 作为一个有商业头脑的资…