会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
贝尔摩德
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
9
10
11
12
13
14
15
16
17
···
19
下一页
2014年2月8日
poj 2186 Popular Cows 强连通
摘要: #include#include#include#include#includeusing namespace std;const int maxn = 10000 + 10;vector G[maxn], G2[maxn];vector S;int vis[maxn], sccno[maxn], ...
阅读全文
posted @ 2014-02-08 21:52 贝尔摩德
阅读(152)
评论(0)
推荐(0)
2014年2月2日
poj1236 Network of Schools 强连通分量
摘要: #include#include#include#include#includeusing namespace std;const int maxn = 100 + 10;vector G[maxn], G2[maxn];vector S;int vis[maxn], sccno[maxn], sc...
阅读全文
posted @ 2014-02-02 12:40 贝尔摩德
阅读(152)
评论(0)
推荐(0)
2014年2月1日
hdu 1394 Minimum Inversion Number 线段树
摘要: 代码出自http://www.notonlysuccess.com/index.php/segment-tree-complete/#include #include using namespace std;#define lson l , m , rt > 1; build(lson); ...
阅读全文
posted @ 2014-02-01 23:00 贝尔摩德
阅读(152)
评论(0)
推荐(0)
2014年1月30日
poj 3177 Redundant Paths 边双连通
摘要: 出自http://blog.csdn.net/wangjian8006/article/details/7990666##include using namespace std;#define MAXV 5010#define min(a,b) (a>b?b:a)int n,m;bool map[M...
阅读全文
posted @ 2014-01-30 15:21 贝尔摩德
阅读(103)
评论(0)
推荐(0)
2014年1月29日
hdu 1251 统计难题 字典树
摘要: #include #include #define maxn 28#define inf 500000int sz;int ch[inf][maxn],val[inf],sum[inf];int idx(char c) { return c-'a';}void init() { sz =...
阅读全文
posted @ 2014-01-29 16:55 贝尔摩德
阅读(116)
评论(0)
推荐(0)
2014年1月14日
后缀数组 倍增算法 出自http://www.cnblogs.com/staginner/archive/2012/02/02/2335600.html
摘要: int wa[maxn],wb[maxn],wv[maxn],ws[maxn];int cmp(int *r,int a,int b,int l){return r[a]==r[b]&&r[a+l]==r[b+l];} //就像论文所说,由于末尾填了0,所以如果r[a]==r[b](实际是y[a]...
阅读全文
posted @ 2014-01-14 14:51 贝尔摩德
阅读(160)
评论(0)
推荐(0)
2014年1月11日
hdu 2686 Matrix hdu 3376 Matrix Again 费用流
摘要: 两道题目十分类似,只是数据量问题,都可以用费用流来解,所以只贴前一道题的代码了,从右下往左上等效从左上往右下,因此即相当于走两次,建图方式同poj3422。#include #include #include using namespace std;const int N=2000;const in...
阅读全文
posted @ 2014-01-11 21:12 贝尔摩德
阅读(163)
评论(0)
推荐(0)
poj Kaka's Matrix Travels 费用流
摘要: 题意:在一个矩阵中每个格子上都有一个非负数,卡卡的一次旅行是从矩阵的左上角移到右下角,并将他走过的格子中的数字累加,并且走过的格子中的数字变为0,问经过k次这样的旅行最多可得到多大的数字。费用流,将每个方格拆成两个点,中间连接一条容量为1的费用为该格子数字的相反数,再连接一条容量为无穷费用为0的路径...
阅读全文
posted @ 2014-01-11 21:03 贝尔摩德
阅读(161)
评论(0)
推荐(0)
poj 2942 Knights of the Round Table 双连通分量
摘要: 白书上的代码#include#include#include#include#includeusing namespace std;struct Edge { int u, v; };const int maxn = 1000 + 10;int pre[maxn], iscut[maxn], bcc...
阅读全文
posted @ 2014-01-11 10:45 贝尔摩德
阅读(167)
评论(0)
推荐(0)
zoj 2588 Burning Bridges 桥
摘要: #include #include #define clr(a) memset(a,0,sizeof(a))#define N 10005#define M 100005int MIN(int a,int b){ if(anext) if(p->j==j) break; if(p!=NULL) {...
阅读全文
posted @ 2014-01-11 10:38 贝尔摩德
阅读(126)
评论(0)
推荐(0)
上一页
1
···
9
10
11
12
13
14
15
16
17
···
19
下一页
公告