Fork me on GitHub

04 2017 档案

摘要:https://www.luogu.org/problem/show?pid=2472这是一道网络流题,主要是构建图(建模),然后用最大流就可以了; 虚构一个汇点和一个源点 构图时,把每个柱子拆成一条边连接两个点,边的容量为柱子高度; 把可以跳出的柱子连到汇点,容量是INF(不影响... 阅读全文
posted @ 2017-04-28 16:55 primes 阅读(168) 评论(0) 推荐(0) 编辑
摘要:http://blog.csdn.net/xzz_hust/article/details/22041173 首先给出割的定义:在图G(V,E)中,将图割成两个不能联通的图的边集即为割;有这样一种题目:求G(V,E)中s点到t点的最小割,这个问题就是求s–>t的最大流, 下面给出解... 阅读全文
posted @ 2017-04-23 10:23 primes 阅读(166) 评论(0) 推荐(0) 编辑
摘要:https://www.luogu.org/problem/show?pid=1343#sub最大流#include#include#include#include#include#include#include#define INF 100000000using namespac... 阅读全文
posted @ 2017-04-23 09:06 primes 阅读(132) 评论(0) 推荐(0) 编辑
摘要:首先感谢(http://blog.csdn.net/x_y_q_/article/details/51999466)核心思路http://blog.csdn.net/x_y_q_/article/details/51999466一、首先是FF算法,dfs找增广路, 奉上最简模板(邻... 阅读全文
posted @ 2017-04-23 08:47 primes 阅读(230) 评论(0) 推荐(0) 编辑
摘要:我觉得AC自动机的难点和核心是构建失败指针,父亲的失败指针的儿子(son2)中有和儿子(son1)相同的,即为son1的失败指针 例 还是有个不懂的地方:第90行,跪求大佬赐教#include#include#include#include#include#include#incl... 阅读全文
posted @ 2017-04-16 11:18 primes 阅读(139) 评论(0) 推荐(0) 编辑
摘要:#include#include#include#include#include#include#includeusing namespace std;int n,m;int num[20009],nxt[20009],head[10009],cnt=0,sum=0;int boo... 阅读全文
posted @ 2017-04-16 08:20 primes 阅读(82) 评论(0) 推荐(0) 编辑
摘要:#include#include#include#include#include#include#includeusing namespace std;int num[200009],dfn[100009],nxt[200009],low[100009],head[100009],... 阅读全文
posted @ 2017-04-16 08:18 primes 阅读(191) 评论(0) 推荐(0) 编辑
摘要:#include#include#include#include#include#includeusing namespace std;int nxt[10009],l1,l2;char s1[100009],s2[10009];void next_make()//求nxt数组{ ... 阅读全文
posted @ 2017-04-16 08:13 primes 阅读(111) 评论(0) 推荐(0) 编辑
摘要:https://www.luogu.org/problem/show?pid=1160#sub 模拟,链表实现即可#include#include#include#include#include#includeusing namespace std;bool f[100009];i... 阅读全文
posted @ 2017-04-09 11:11 primes 阅读(176) 评论(0) 推荐(0) 编辑
摘要:https://www.luogu.org/problem/show?pid=1113#sub(一开始写了拓扑,然而没有考虑周到,全WA,然后发现不好改,弃疗;考虑到问题的特殊性,换了递推)问题的特殊性:John有需要完成的n个杂务的清单,并且这份清单是有一定顺序的,杂务k(k>1... 阅读全文
posted @ 2017-04-09 10:33 primes 阅读(107) 评论(0) 推荐(0) 编辑
摘要:https://www.luogu.org/problem/show?pid=1119#sub 弗洛伊德其实是一个三维的dp 以k为中间点时,f[k][i][j]=min(f[k][i][j],f[k-1][i][j]); 这个题询问的时间是有顺序的,所以可以改为两维, floyd... 阅读全文
posted @ 2017-04-09 10:21 primes 阅读(174) 评论(0) 推荐(0) 编辑
摘要:https://www.luogu.org/problem/show?pid=1198#sub因为询问的是末尾L个数中的最大数。由于L不固定,所以用单调栈而不是单调队列。于是需要维护一个单调递减栈。插入操作和单调队列一样,当当前数大于栈顶时栈顶出栈,然后当前数进栈。由于栈底不能像队... 阅读全文
posted @ 2017-04-08 16:30 primes 阅读(145) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示