
贪心
文章平均质量分 80
alfredtofu
这个作者很懒,什么都没留下…
展开
-
poj 1042 钓鱼问题 枚举+贪心
#include #include int f[25]; //第一个五分钟能钓到的鱼 int curF[25]; //目前各湖能钓到的鱼数 int d[25]; //每五分钟鱼量减少的数目 int ans[25]; //能钓到最大鱼数时各湖停留的时间 int ansTmp[25]; int t[25]; //从i走到i+1所需要的时间 int n; int times;原创 2011-02-22 12:36:00 · 1059 阅读 · 0 评论 -
hdu 3794 Magic Coupon
<br />好久没写blog了,来一道水题吧,分组贪心<br />#include <iostream> #include <algorithm> #include <cstdio> using namespace std; typedef long long ll; ll p[1000010]; ll c[1000010]; int main() { int np, nc; ll ans = 0; while(scanf("%d", &nc) != EOF && nc >= 0)原创 2011-03-23 10:38:00 · 876 阅读 · 1 评论