会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
kewowlo
博客园
首页
新随笔
联系
管理
订阅
上一页
1
2
3
4
5
6
7
8
9
···
21
下一页
2014年10月12日
【树的直径】 POJ 1985 Cow Marathon
摘要: 给出一棵树 ,和边的权值求权值最长的一条直径两次bfs求第一次以任意点开始 BFS求出第一个端点第二次以第一次得到的端点 BFS求出第二个端点#include #include #include #include #include #include #include #include #includ...
阅读全文
posted @ 2014-10-12 18:29 kewowlo
阅读(163)
评论(0)
推荐(0)
2014年10月9日
【费用流】 HDU 1853 Cyclic Tour 费用流 完备匹配(裸题)
摘要: n个城市m条街道 要求完全匹配#include #include #include #include #include #include #include #include using namespace std;#include #include #include #include #includ...
阅读全文
posted @ 2014-10-09 22:24 kewowlo
阅读(138)
评论(0)
推荐(0)
【网络流】 HDU 4309 Seikimatsu Occult Tonneru 状压枚举边
摘要: 题意:有三种类型的路类型 1. 从 U 到 V 能走INF个人 能躲 d 个人类型 2. 从 U 到 V 能走INF 个人 不能 躲人类型 3. 从 U 到 V 能走INF 个人 要用该路时需要花费一定费用要求能躲最多人 且花费最少类型3 的路最多有 12 条所以我们用二进制 枚举 类型3(也有递归...
阅读全文
posted @ 2014-10-09 22:16 kewowlo
阅读(144)
评论(0)
推荐(0)
2014年10月8日
【网络流】 HDU 3157 Crazy Circuits 有源汇上下界最小流
摘要: 最小流解法:先按照【上下界可行流】建图 但先不建end --> star 边MAXFlow=按新建的源点和汇点跑一次最大流再建end->star的边MAXFlow+=再按新建的源点和汇点跑一次最大流如果MAXFlow == 新建源点流出的sum值则 有ans = end->star的流量否则无ans...
阅读全文
posted @ 2014-10-08 22:25 kewowlo
阅读(157)
评论(0)
推荐(0)
【网络流】 ZOJ 3229 Shoot the Bullet 有源汇上下界最大流
摘要: 完全看不下题目啊!!!全被这小萝莉吸引了啊!!!!!第i天与人建边源点与天建边汇点与人建边先判断是否可行然后输出#include #include #include #include #include #include #include #include using namespace std;#i...
阅读全文
posted @ 2014-10-08 20:07 kewowlo
阅读(155)
评论(0)
推荐(0)
【网络流】 SGU 194 Reactor Cooling 无源无汇上下界可行流(裸题)
摘要: 传送门ISAP好长啊。。。居然打了20分钟。。。。#include #include #include #include #include #include #include #include using namespace std;#include #include #include #inclu...
阅读全文
posted @ 2014-10-08 16:29 kewowlo
阅读(194)
评论(0)
推荐(0)
2014年10月7日
网络流总结(边学边总结)
摘要: 文章:1.有上下界网络流问题2.一种简易的方法求解流量有上下界的网络中网络流问题3.上下界网络流上界用ci表示,下界用bi表示。若题目无下界则bi为01.无源汇可行流:下界是必须流满的,那么对于每一条边,去掉下界后,其自由流为ci– bi。Mi = sigma(i点进来的下界流) - sigma(i...
阅读全文
posted @ 2014-10-07 21:33 kewowlo
阅读(214)
评论(0)
推荐(0)
【搜索】 HDU 3152 Obstacle Course
摘要: 优先队列点按数值最小出队#include #include #include #include #include #include #include #include using namespace std;#include #include #include #include #include #...
阅读全文
posted @ 2014-10-07 19:46 kewowlo
阅读(164)
评论(0)
推荐(0)
2014年10月6日
【瞎搞】 HDU 3101 The Heart of the Country
摘要: 比赛时愣是没读懂题意:有N 个城市 每个城市都有 val 个 士兵 , 有几条路连接当敌方攻击你的某个城市时 该城市以及与该城市相连接的城市的士兵总数 要大于 K不大于 K 该城市就被攻陷,士兵被俘虏 则不能支援别的城市求最后一共有多少城市不被攻陷,以及士兵总数思路:先计算该点能支援到的总士兵数然后...
阅读全文
posted @ 2014-10-06 20:58 kewowlo
阅读(174)
评论(0)
推荐(0)
【二分】 HDU 2446 Shell Pyramid
摘要: 题意:很多球组成一个金字塔第x层有 x*(x+1)/ 2 个球给你一个S 表示金字塔一层一层数下来的第S个球它在哪一层 这层中的第几行 第几列公式 1 : x*(x+1)*(x+2)/ 6公式 2 :x*(x+1)/ 2公式1为公式2 的前n项和#include #include #include ...
阅读全文
posted @ 2014-10-06 08:39 kewowlo
阅读(135)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
···
21
下一页
公告