本文版权归点A点C和博客园共有,欢迎转载,但必须保留此段声明,并给出原文连接,谢谢合作!!!

2012年10月6日

hdu2187 悼念512汶川大地震遇难同胞——老人是真饿了

摘要: 直接排序,捡便宜的买!View Code 1 #include<stdio.h> 2 #include<string.h> 3 #include<iostream> 4 #include<algorithm> 5 using namespace std; 6 struct node 7 { 8 int p; 9 int h;10 };11 struct node mi[1001];12 int cmp(const void *a,const void *b)13 {14 return (*(node*)a).p>=(*(node*)b).p 阅读全文

posted @ 2012-10-06 19:03 点A点C 阅读(532) 评论(0) 推荐(0) 编辑

hdu2124 Repair the Wall

摘要: 题意:有个1*L的裂缝,有N个宽度为1长度为Ai的木板,木板可以锯断,用尽可能少的木板来修补裂缝,输出最少要用多少块木板,如果不能修不好输出impossible。贪心,直接把木板从大到小排序,捡着大的用!AC代码,0ms,742BView Code 1 #include<stdio.h> 2 #include<string.h> 3 #include<iostream> 4 #include<algorithm> 5 using namespace std; 6 __int64 ai[620]; 7 int cmp(int a,int b) 8 阅读全文

posted @ 2012-10-06 17:51 点A点C 阅读(98) 评论(0) 推荐(0) 编辑

导航