摘要:
题意:有n个湖,每个湖有一个初始的每单位时间的上钩鱼数,在那里钓鱼时该上钩率会以di的速率不断下降,不钓的时候上钩率不变。这n个湖是排成一排的,从第一个湖开始每个单位时间可以选择钓鱼或者往下一个湖走,这些路是单向的不能往回走。给定总时间h,问最多能钓到多少鱼。分析:我们依次枚举究竟要在前多少个湖钓鱼,那么我们可以先将路上的时间计算好,然后人为我们可以在这几个湖之间瞬间转移,每次挑一个上钩率最高的湖去钓即可。View Code #include <iostream>#include <stdio.h>using namespace std;const int maxn=2 阅读全文
posted @ 2013-01-15 18:25
undefined2024
阅读(1909)
评论(0)
推荐(0)
摘要:
本来是离散化的题,当初用了一种比较与众不同的做法View Code #include <iostream>#include <cstdlib>#include <iomanip>using namespace std;const int maxn=500;struct cube{ double l,r,u,d;};void init();void work();void print();void cut(int j);int n,no=0,tot;double ans;cube c[maxn],ls;int... 阅读全文
posted @ 2013-01-15 18:17
undefined2024
阅读(375)
评论(0)
推荐(0)
摘要:
简单题,注意9的倍数的情况View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 1005char st[maxn];int main(){ //freopen("t.txt", "r", stdin); while (scanf("%s", st), strcmp(st, "0")) { int 阅读全文
posted @ 2013-01-15 18:12
undefined2024
阅读(162)
评论(0)
推荐(0)
摘要:
简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;double cal(int a){ int temp = 1; double ret = 0; for (int i = 1; i <= a; i++) { temp *= i; ret += 1.0 / temp; } return ret + 1; }int main(){ freopen("t.txt", 阅读全文
posted @ 2013-01-15 16:55
undefined2024
阅读(207)
评论(0)
推荐(0)
摘要:
简单模拟View Code #include <iostream>#include <string>using namespace std;string html;void work(){ bool begin=true; int now=0,temp=0,i; string word; while (cin>>word) { if (word=="<br>") { cout<<endl; now=0; continue; }... 阅读全文
posted @ 2013-01-15 16:09
undefined2024
阅读(135)
评论(0)
推荐(0)

浙公网安备 33010602011771号