In a highly modernized fishing village, inhabitants there make a living on fishery. Their major tools, fishing nets, are produced and fixed by computer. After catching fishes each time, together with plenty of fishes, they will bring back the shabby…
1.链接地址: http://bailian.openjudge.cn/practice/1042/ http://poj.org/problem?id=1042 2.题目: Gone Fishing Time Limit: 2000MS Memory Limit: 32768K Total Submissions: 27652 Accepted: 8199 Description John is going on a fishing trip. He has h hours avail…
Gone Fishing Time Limit: 2000MS Memory Limit: 32768K Total Submissions: 30281 Accepted: 9124 Description John is going on a fishing trip. He has h hours available (1 <= h <= 16), and there are n lakes in the area (2 <= n <= 25) all reachab…
Gone Fishing John is going on a fising trip. He has h hours available (1 ≤ h ≤ 16), and there are n lakes in the area (2 ≤ n ≤ 25) all reachable along a single, one-way road. John starts at lake 1, but he can finish at any lake he wants. He can only…
Gone Fishing John is going on a fishing trip. He has h hours available, and there are n lakes in the area all reachable along a single, one-way road. John starts at lake 1, but he can finish at any lake he wants. He can only travel from one lake to t…
In a highly modernized fishing village, inhabitants there make a living on fishery. Their major tools, fishing nets, are produced and fixed by computer. After catching fishes each time, together with plenty of fishes, they will bring back the shabby…
题目网站:http://acm.hdu.edu.cn/showproblem.php?pid=6709 Problem Description Heard that eom is a fishing MASTER, you want to acknowledge him as your mentor. As everybody knows, if you want to be a MASTER’s apprentice, you should pass the trial. So when yo…
Description Heard that eom is a fishing MASTER, you want to acknowledge him as your mentor. As everybody knows, if you want to be a MASTER's apprentice, you should pass the trial. So when you find fishing MASTER eom, the trial is as follow: There are…
传送门 •参考资料 [1]:2019CCPC网络选拔赛 H.Fishing Master(思维+贪心) •题意 池塘里有 n 条鱼,捕捉一条鱼需要花费固定的 k 时间: 你有一个锅,每次只能煮一条鱼,其中煮熟第 i 条鱼至少需要 ti 时间: 你在煮鱼的时候可以选择去钓一条鱼,也可也选择不钓: 但是,一旦你决定钓鱼,就必须花费 k 时间调到一条鱼: 任何时刻,你都可以有多条鱼待煮: 问将所有的鱼钓上来并煮熟所有的鱼最少需要多少时间: •题解 理想的方案是只有在钓第一条鱼的时候锅是空的,其余任意时…
题目:http://acm.hdu.edu.cn/showproblem.php?pid=6709 Fishing Master Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 631 Accepted Submission(s): 170 Problem Description Heard that eom is a fishin…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1015 题意:给出一个n个点的无向图,询问是否为弦图,弦图定义为对于图中任意长度>3的环一定存在环上不相邻的点有边相连(n<=1000) #include <bits/stdc++.h> using namespace std; const int N=1005; int n, m, ihead[N], cnt, tag[N], pos[N]; bool vi…
弦图判定 代码 #include<cstdio> #include<queue> #define mp make_pair #define fi first #define sc second using namespace std; ; int n,m,a,b,i,j; int dp,p[N],pre[N],tt[N],o,vis[N],sum[N],id[N],ID[N]; priority_queue<pair<int,int> > Q; void l…
I used DP instead of Greedy. But got WA on PoJ, though it passed all web-searched cases. Maybe I have to use Greedy. BTW: a careless modification introduced an error, and it took me 1+ hours to debug. DETAILS Sth. about this DP solution: dp[iLake][nC…
(- ̄▽ ̄)-* #include<iostream> #include<cstdio> #include<cstring> using namespace std; ; int n,h,H;//H:记录原本有多少小时的时间:h:贪心的时候,防止H被修改 int res[N],RES[N];//res[]:贪心的时候保存结果:RES[]:用于记录最终结果 int maxn,sum;//maxn:保存最终结果,即捕到的鱼最大值:sum:每轮贪心的时候,用来保存鱼最大值 s…
题面 Vjudge Sol 给出一个n个点的无向图,询问是否为弦图 做法见上上上篇博客 # include <bits/stdc++.h> # define RG register # define IL inline # define Fill(a, b) memset(a, b, sizeof(a)) using namespace std; const int _(1005); typedef long long ll; IL int Input(){ RG int x = 0, z =…
dbzoj vjudge1 vjudge2 sol 给一个无向图,求判定是不是弦图. sol 还是弦图那套理论. 复杂度是\(O(n^2)\)的,因为\(m\)本质上和\(n^2\)是同级的. code #include<cstdio> #include<algorithm> #include<vector> using namespace std; int gi() { int x=0,w=1;char ch=getchar(); while ((ch<'0'|…