摘要: 蒟蒻也能写出来的AC代码!这题是AC自动机模板题。插入单词时用一个没出现过的字符隔开就行了。 一些细节请看注释 cpp include include include include using namespace std; char a[1000005], b[1000205];//b数组要开这么 阅读全文
posted @ 2017-12-07 10:05 poorpool 阅读(396) 评论(0) 推荐(0) 编辑
摘要: 纪念一下我一晚上写了八遍AC自动机 这是加强版的: cpp include include include include using namespace std; int n, cnt[155], mp[155], len, maxn; char a[155][75], b[1000005]; q 阅读全文
posted @ 2017-12-05 21:38 poorpool 阅读(206) 评论(2) 推荐(0) 编辑
摘要: treap求中位数。 cpp include include include using namespace std; typedef long long ll; int n, m, rot, siz, uu, vv; ll h[1005], all, num, tmp, ans[1005][100 阅读全文
posted @ 2017-12-04 21:40 poorpool 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 并查集+treap维护的第k 大 数 cpp include include include using namespace std; struct Node{ int val, l, r, rnd, sze, hav; }nd[200005]; int n, m, fa[200005], hmn[ 阅读全文
posted @ 2017-12-04 20:15 poorpool 阅读(218) 评论(0) 推荐(0) 编辑
摘要: treap做法,参考 "hzwer的博客" splay做法,参照 "zyf2000" ,但是一般我们用splay都是维护区间的 阅读全文
posted @ 2017-12-04 18:52 poorpool 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 模板题 cpp include include using namespace std; struct Edge{ int too, nxt; }edge[200005]; int n, m, dfn[100005], loo[100005], ind, uu, vv, cnt, hea[10000 阅读全文
posted @ 2017-12-04 10:51 poorpool 阅读(185) 评论(0) 推荐(0) 编辑
摘要: K短路裸题。 阅读全文
posted @ 2017-12-03 20:28 poorpool 阅读(156) 评论(0) 推荐(0) 编辑
摘要: ```cpp include include include include using namespace std; typedef unsigned long long ull; struct Node{ ull val1, val2; }node[10005]; char a[1505]; i 阅读全文
posted @ 2017-12-03 18:33 poorpool 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 注意:如果是这么个写法,堆数组要开成n+m的。 为什么呢?设想一下从1到2有m条长度递减的路,这岂不是要入队m次…… cpp include include include include using namespace std; struct Edge{ int too, nxt, val; }e 阅读全文
posted @ 2017-12-02 11:37 poorpool 阅读(166) 评论(0) 推荐(0) 编辑
摘要: ```cpp include include include include using namespace std; int n, m, s, dis[10005], din, uu, vv, ww, hea[10005], cnt; bool vis[10005]; struct Node{ i 阅读全文
posted @ 2017-12-01 21:49 poorpool 阅读(178) 评论(0) 推荐(0) 编辑