上一页 1 2 3 4 5 6 7 8 9 ··· 15 下一页
摘要: struct Matrix { LL mat[MAXN][MAXN]; int r,c; Matrix (int r = 0 ,int c = 0) { init(r,c); } void init(int r = 0,int c = 0) { this -> r = r; this -> c = 阅读全文
posted @ 2016-01-29 15:03 Commence 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 模板: struct Ac_Automation { int ch[MAXNNODE][SIGMA_SIZE]; int val[MAXNNODE]; int fail[MAXNNODE],last[MAXNNODE]; bool symbol[MAXNNODE]; int sz; Ac_Autom 阅读全文
posted @ 2016-01-29 14:53 Commence 阅读(452) 评论(0) 推荐(0) 编辑
摘要: 首先是几份模版KMPvoid kmp_pre(char x[],int m,int fail[]){ int i,j; j = fail[0] = -1; i = 0; while (i = m) { ans++; j... 阅读全文
posted @ 2015-12-21 16:13 Commence 阅读(526) 评论(0) 推荐(0) 编辑
摘要: 以前一直不知道该咋搞这个比较好。感觉推起来那个数字好麻烦。后来有一种比较好的写法就是直接的DFS写法。相应的ismax表示当前位是否有限制。数位DP也是有一种类似模版的东西,不过需要好好理解。与其他模版不同。主要还是状态的定义模版就不整理了。直接上题。另外这里有一道题是数位DP+自动机的放到自动机里... 阅读全文
posted @ 2015-12-12 20:02 Commence 阅读(329) 评论(0) 推荐(0) 编辑
摘要: 模版整理:晒素数void init(){ cas = 0; for (int i = 0 ; i 1) { res[cnt++] = x; tot++; }大素数筛。1-2^31内某... 阅读全文
posted @ 2015-12-09 22:38 Commence 阅读(410) 评论(0) 推荐(0) 编辑
摘要: 专题基本全都是模版应用。贴一下模版 平面最近点对 POJ 2318 TOYS 给出区域,要你算出给出的每个点在第几个区域里 利用叉积的方向性二分判断在第几个区域内 #include <map> #include <set> #include <list> #include <cmath> #incl 阅读全文
posted @ 2015-11-28 16:38 Commence 阅读(419) 评论(0) 推荐(0) 编辑
摘要: 讲解就在这里http://www.cnblogs.com/zhj5chengfeng/archive/2013/07/29/3224092.html说的很清晰,列举的题目也比较简单重要的几个结论1、最大团点的数量=补图中最大独立集点的数量2、二分图中,最大独立集点的数量+最小覆盖点的数量=整个图点的... 阅读全文
posted @ 2015-11-07 16:14 Commence 阅读(456) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #inclu... 阅读全文
posted @ 2015-11-07 14:41 Commence 阅读(286) 评论(0) 推荐(0) 编辑
摘要: 题意:给一个网络中某些边增加容量,增加的总和最大为K,使得最大流最大。费用流:在某条边增加单位流量的费用。那么就可以2个点之间建2条边,第一条给定边(u,v,x,0)这条边费用为0同时另一条边(u,v,K,1)费用为1,那么就可以通过限制在增广时相应的费用即可找出最大流个人觉得这样做的原因是每次增光... 阅读全文
posted @ 2015-11-01 19:49 Commence 阅读(429) 评论(0) 推荐(0) 编辑
摘要: 二分匹配:二分图的一些性质 二分图又称作二部图,是图论中的一种特殊模型。 设G=(V,E)是一个无向图,如果顶点V可分割为两个互不相交的子集(A,B),并且图中的每条边(i,j)所关联的两个顶点i和j分别属于这两个不同的顶点集(i in A,j in B),则称图G为一个二分图。 1。一个二分图中的 阅读全文
posted @ 2015-10-29 20:04 Commence 阅读(815) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 15 下一页