雕刻时光

just do it……nothing impossible
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年11月18日

摘要: http://poj.org/problem?id=3045贪心,按Wi+Si排列对于最后一个位置,risk=W总-Wn-Sn,使得risk最小的是最大的(Wi+Si)。View Code #include<iostream>#include<stdio.h>#include<string.h>#include<algorithm>using namespace std;struct data{ int w,p; long long all;}node[50009];int cmp(data a,data b){ return (a.p+a.w) 阅读全文

posted @ 2011-11-18 21:09 huhuuu 阅读(173) 评论(0) 推荐(0) 编辑