摘要: 题目:UVA-11300-Spreading the Wealth思路:对于人i有 现有Ai-出xi+入xi+1=平均M,Ci=Σ1~i(Ai-M),得C中有x0使得0,C1~Cn-1与其差的和最小,即为answer,x0为C中位数。wa#include #include#include#inclu... 阅读全文
posted @ 2015-01-22 18:08 alohagin 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 题目:UVA-11729-Commando War贪心,按执行时间从大到小排序。 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 9 struct job{10 int b,j;... 阅读全文
posted @ 2015-01-22 15:41 alohagin 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 题目:hdu-1902-The Dragon of Loowater贪心,两遍排序。 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 9 int nn[20010],mm[200... 阅读全文
posted @ 2015-01-22 12:31 alohagin 阅读(133) 评论(0) 推荐(0) 编辑