会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
贝尔摩德
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
10
11
12
13
14
15
16
17
18
19
下一页
2013年12月23日
hdu 1754 I Hate It 线段树
摘要: #include #include #define N 200200int max[4*N];int n,m;int A,B;int L,R;int MAX(int a,int b){ if(a>b) return a; else return b;}int MIN(int a,int b){ if...
阅读全文
posted @ 2013-12-23 00:24 贝尔摩德
阅读(106)
评论(0)
推荐(0)
2013年12月22日
hdu 4292 Food 最大流
摘要: 将人拆点,之间连接一条容量为1的边,表示一个人只能选一次,从s到每种食物连接一条容量为该种食物总数的边,从每种饮料连接一条容量为该种饮料总量的边,如果一个人喜欢某种食物或饮料,连边即可。#include #include #include using namespace std;const int ...
阅读全文
posted @ 2013-12-22 21:23 贝尔摩德
阅读(98)
评论(0)
推荐(0)
2013年12月21日
hdu 2222 Keywords Search AC自动机
摘要: AC自动机的裸题,不过需要注意几个地方,keywords中有重复的,而且模板中会重复出现keywords~#include #include #define SIGMA_SIZE 26#define MAXNODE 500100using namespace std;int ch[MAXNODE][...
阅读全文
posted @ 2013-12-21 11:50 贝尔摩德
阅读(176)
评论(0)
推荐(0)
2013年12月20日
hdu 3572 Task Schedule hdu 2883 kebab 最大流
摘要: 注意一个地方,在建立好层次图进行dfs增广时,如果某个点增广不出流量,那么将该点level值置为0,即将它在该层次图中删除,剪枝,否则会超时~#include #include #include using namespace std;const int maxn=1050;#define inf ...
阅读全文
posted @ 2013-12-20 16:18 贝尔摩德
阅读(162)
评论(0)
推荐(0)
2013年12月17日
poj 1966 Cable TV Network 点连通度
摘要: #include #include #define Max 300#define INF 5000000int flow[Max][Max],d[Max];int map[Max][Max];int sta,end; int m,n;int min(int a,int b){ if(a0&&d...
阅读全文
posted @ 2013-12-17 20:38 贝尔摩德
阅读(139)
评论(0)
推荐(0)
2013年12月15日
hdu 2236 匹配
摘要: #include #include #define maxn 110int nx,ny;int map[maxn][maxn],ans,sx[maxn],sy[maxn];int cx[maxn],cy[maxn];int down;int l,r,mid;int path(int u){ s...
阅读全文
posted @ 2013-12-15 13:16 贝尔摩德
阅读(120)
评论(0)
推荐(0)
2013年12月12日
zoj 2429 Destroying The Graph 最小点权覆盖
摘要: #include #include #include using namespace std;#define Max 230#define INF 100000000int flow[Max][Max],d[Max];int vis[Max*3];int sta,end; vector sum;i...
阅读全文
posted @ 2013-12-12 17:12 贝尔摩德
阅读(127)
评论(0)
推荐(0)
poj 3469 Dual Core CPU 最小割
摘要: #include #include #include using namespace std;const int maxn=20000+50,inf=100000000;int n,m;int level[maxn],que[maxn*10];int head[maxn*3],lon;int min...
阅读全文
posted @ 2013-12-12 17:00 贝尔摩德
阅读(103)
评论(0)
推荐(0)
2013年12月10日
hdu 4496 D-City 并查集
摘要: #include #include #define maxn 10050int n,m;int p[maxn],x[maxn*10],y[maxn*10];int find(int x){ if(p[x]==x) return x; else return p[x]=find(p[x]);}int ...
阅读全文
posted @ 2013-12-10 23:25 贝尔摩德
阅读(94)
评论(0)
推荐(0)
2013年12月9日
Kosaraju算法的分析和证明 转自http://blog.sina.com.cn/s/blog_4dff87120100r58c.html
摘要: Kosaraju算法是求解有向图强连通分量(strongconnectedcomponent)的三个著名算法之一,能在线性时间求解出一个图的强分量。用Sedgewick爷爷的话说,就是“现代算法设计的胜利”。什么是强连通分量?在这之前先定义一个强连通性(strongconnectivity)的概念:...
阅读全文
posted @ 2013-12-09 11:27 贝尔摩德
阅读(279)
评论(0)
推荐(0)
上一页
1
···
10
11
12
13
14
15
16
17
18
19
下一页
公告