上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 41 下一页
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5438 题意:有n个池塘和m个管道;每个池塘的价值是v, 现在由于资金问题要删除池塘;但是删除的池塘必须是最多只连接一个管道,否则会爆炸; 求最后相连的池塘有奇数个的价值总和是多少; #include<i Read More
posted @ 2015-09-15 20:23 西瓜不懂柠檬的酸 Views(326) Comments(0) Diggs(0)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1532最大流模板题;EK:(复杂度为n*m*m);#include#include#include#includeusing namespace std;#define INF 0xfffffff#def... Read More
posted @ 2015-09-12 14:57 西瓜不懂柠檬的酸 Views(160) Comments(0) Diggs(0)
题目链接:http://poj.org/problem?id=1860题解:两种情况YES,一种是存在正权回路; 一种是求最长路后,实现了增值,也是YES;用spfa来判断是否存在正权回路,其实spfa是可以用来判断是否存在回路的,不管是正权还是负权,只不过它们松弛的条件不同,正权的话,... Read More
posted @ 2015-09-10 20:02 西瓜不懂柠檬的酸 Views(232) Comments(0) Diggs(0)
题目链接:http://poj.org/problem?id=3259题意是问是否能通过虫洞回到过去;虫洞是一条单向路,不但会把你传送到目的地,而且时间会倒退Ts。我们把虫洞看成是一条负权路,问题就转化成求一个图中是否存在负权回路;1.bellman_ford算法Bellman-Ford算法流程分为... Read More
posted @ 2015-09-10 11:12 西瓜不懂柠檬的酸 Views(2861) Comments(0) Diggs(1)
题目链接:http://poj.org/problem?id=1703可以认为n个人和m句话;每句话包含A a b;D a b;刚开始关系不确定;A a b 就是问ab 是否同类;Da b就是告诉我们ab不同类;#include #include #include #include #include... Read More
posted @ 2015-09-07 20:20 西瓜不懂柠檬的酸 Views(161) Comments(0) Diggs(0)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1155 题目很长,但是很容易理解,就是人从高s的桥上跳下来,手拉着长为l的绳子末端,如果绳子太短那么人将在空中输出Stuck in the air. 如果人落地速度大于10的话就死了,输出Killed b Read More
posted @ 2015-09-05 13:55 西瓜不懂柠檬的酸 Views(217) Comments(0) Diggs(0)
http://acm.hdu.edu.cn/showproblem.php?pid=2199给出y的值求x;8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 = Yx是0到100的实数所以要用二分的方法;#include #include #include #include #incl... Read More
posted @ 2015-09-04 13:56 西瓜不懂柠檬的酸 Views(140) Comments(0) Diggs(0)
题目链接:http://poj.org/problem?id=2186 求有多少个点满足其他n-1个点都能到达这个点,是单向图; 所以我们可以把图进行缩点,之后求出度为0的那个点内包含的点的个数就是求得答案; 如果出度为0的不止一个,那么答案为0; #include<cstdio> #include Read More
posted @ 2015-08-21 11:20 西瓜不懂柠檬的酸 Views(128) Comments(0) Diggs(0)
题目链接:http://acm.fzu.edu.cn/problem.php?pid=2128刚开始怎么也看不出来样例的答案;还好突然觉悟;具体看代码吧;#include#include#include#include#define N 1001000using namespace std;stru... Read More
posted @ 2015-08-19 19:22 西瓜不懂柠檬的酸 Views(139) Comments(0) Diggs(0)
题目链接:http://poj.org/problem?id=1184分析:首先可以发现有6*10^6种状态,比较多,不过搜索的时候可以去除一些无用的状态,可以发现一个点的值(2-5)如果想要改变那么光标必须在该点处,所以当光标在2-5位置时候,必须要要把值变为与目标位置处一样才可以移动。单搜:#i... Read More
posted @ 2015-08-19 10:24 西瓜不懂柠檬的酸 Views(301) Comments(0) Diggs(0)
上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 41 下一页
levels of contents