上一页 1 ··· 55 56 57 58 59 60 61 62 63 ··· 79 下一页
摘要: http://codeforces.com/problemset/problem/241/E首先检测哪些点会出现在从起点到终点的路上,可以用dfs或者迭代,然后,对于所有的边,设f为边起点,t为边终点,dp[i]为从起点出发到i点所必须花费的时间,则当dp[t]>dp[f]+2,也就是超出限制时,把... 阅读全文
posted @ 2015-03-16 14:50 雪溯 阅读(341) 评论(0) 推荐(0) 编辑
摘要: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1676对顶点i,j,起点s=1,终点t=n,可以认为题意要求一组01矩阵use[i][j],使得aveCost=sigma(use[i][j]*cost[i][j])/sigma(... 阅读全文
posted @ 2015-03-16 13:18 雪溯 阅读(211) 评论(0) 推荐(0) 编辑
摘要: http://acm.timus.ru/problem.aspx?space=1&num=1040题目要求在一个联通无向图中找出一种方法给边标号使得任意一个有多条边的点,边的号码的最大公约数都为1想象在dfs树上,以1为根进入,将第一条边标为序号1,则节点1满足条件剩下的边遵照dfs顺序表明,那么非... 阅读全文
posted @ 2015-03-15 02:01 雪溯 阅读(317) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5186题意是分别对每一位做b进制加法,但是不要进位模拟,注意:1 去掉前置0 2 当结果为0时输出0,而不是全部去掉#include #include #include using namespace std;co... 阅读全文
posted @ 2015-03-15 00:01 雪溯 阅读(153) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2612bfs两次就可将两个人到达所有kfc的时间求出,取两人时间之和最短的即可,这个有点不符合实情,题目应该出两人最大时间最小才对#include #include #include using namespace... 阅读全文
posted @ 2015-03-14 20:30 雪溯 阅读(156) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1495第三个杯子的盛水量可由前两个杯子得到,而前两个杯子状态总数在100*100以内,穷举可实现#include #include #include using namespace std;const int mx... 阅读全文
posted @ 2015-03-14 20:27 雪溯 阅读(654) 评论(0) 推荐(1) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1241对每个还未访问的点bfs,到达的点都标为一块,最后统计有多少块即可#include #include #include using namespace std;const int maxn=101;const... 阅读全文
posted @ 2015-03-14 20:24 雪溯 阅读(115) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3984典型的迷宫问题,记录最快到达某个点的是哪个点即可#include #include #include using namespace std;const int maxn=10;const int inf=0x3fffffff;struct... 阅读全文
posted @ 2015-03-14 20:21 雪溯 阅读(166) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2671首先对火进行一次bfs,得到着火时间,然后对人进行一次bfs,只允许进入还没有着火的点注意:出迷宫条件... 阅读全文
posted @ 2015-03-14 20:18 雪溯 阅读(142) 评论(0) 推荐(0) 编辑
摘要: http://acm.fzu.edu.cn/problem.php?pid=2150注意这道题可以任选两个点作为起点,但是时间仍足以穷举两个点的所有可能#include #include #include using namespace std;const int maxn=11;const int... 阅读全文
posted @ 2015-03-14 20:13 雪溯 阅读(206) 评论(0) 推荐(0) 编辑
上一页 1 ··· 55 56 57 58 59 60 61 62 63 ··· 79 下一页