摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1009贪心算法,以最大方式换得最大猫粮,先求猫粮的“性价比”,然后排序,再按性价比去依次将老鼠换完,得到结果View Code 1 #include<stdio.h> 2 #include<stdlib.h> 3 struct fat{ 4 double t,j,f; 5 };//使用数组,容易书写 6 int main() 7 { 8 int m,n,i,k; 9 double sum;10 struct fat cat[1001],temp;11 wh... 阅读全文
posted @ 2013-03-27 13:02 执着追求的IT小小鸟 阅读(297) 评论(0) 推荐(0) 编辑