Im_hear

导航

2012年4月19日

zoj 3607

摘要: 一道贪心的最优题,要求卖出的面包平均价格最大。两点要注意:1、如果第i个顾客买到面包,则前面的人都必须买到面包。2、要对前i个人计算平均价格,需要满足(max)Wj{j = 1..i} < v[i+1]-v[i]才行。第二点是出错的亮点,省赛,因她而美丽。source code 阅读全文

posted @ 2012-04-19 21:00 Im_hear 阅读(328) 评论(0) 推荐(0) 编辑

zoj 3607

摘要: View Code 1 #include <cstdio> 2 #include <iostream> 3 #include <algorithm> 4 #include <iomanip> 5 using namespace std; 6 7 const int N = 1003; 8 9 int main()10 { 11 cout << setiosflags(ios::fixed) << setiosflags(ios::right) << setprecision(6);12 int cas,n;13 阅读全文

posted @ 2012-04-19 20:33 Im_hear 阅读(231) 评论(0) 推荐(0) 编辑