上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 19 下一页
摘要: #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 贝尔摩德 阅读(148) 评论(0) 推荐(0) 编辑
摘要: #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 贝尔摩德 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 代码出自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 贝尔摩德 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 出自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 贝尔摩德 阅读(97) 评论(0) 推荐(0) 编辑
摘要: #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 贝尔摩德 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 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 贝尔摩德 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 两道题目十分类似,只是数据量问题,都可以用费用流来解,所以只贴前一道题的代码了,从右下往左上等效从左上往右下,因此即相当于走两次,建图方式同poj3422。#include #include #include using namespace std;const int N=2000;const in... 阅读全文
posted @ 2014-01-11 21:12 贝尔摩德 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 题意:在一个矩阵中每个格子上都有一个非负数,卡卡的一次旅行是从矩阵的左上角移到右下角,并将他走过的格子中的数字累加,并且走过的格子中的数字变为0,问经过k次这样的旅行最多可得到多大的数字。费用流,将每个方格拆成两个点,中间连接一条容量为1的费用为该格子数字的相反数,再连接一条容量为无穷费用为0的路径... 阅读全文
posted @ 2014-01-11 21:03 贝尔摩德 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 白书上的代码#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 贝尔摩德 阅读(163) 评论(0) 推荐(0) 编辑
摘要: #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 贝尔摩德 阅读(121) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 19 下一页