摘要:
蒟蒻也能写出来的AC代码!这题是AC自动机模板题。插入单词时用一个没出现过的字符隔开就行了。 一些细节请看注释 cpp include include include include using namespace std; char a[1000005], b[1000205];//b数组要开这么 阅读全文
摘要:
纪念一下我一晚上写了八遍AC自动机 这是加强版的: cpp include include include include using namespace std; int n, cnt[155], mp[155], len, maxn; char a[155][75], b[1000005]; q 阅读全文
摘要:
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 阅读全文
摘要:
并查集+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[ 阅读全文
摘要:
treap做法,参考 "hzwer的博客" splay做法,参照 "zyf2000" ,但是一般我们用splay都是维护区间的 阅读全文
摘要:
模板题 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 阅读全文
摘要:
K短路裸题。 阅读全文
摘要:
```cpp include include include include using namespace std; typedef unsigned long long ull; struct Node{ ull val1, val2; }node[10005]; char a[1505]; i 阅读全文
摘要:
注意:如果是这么个写法,堆数组要开成n+m的。 为什么呢?设想一下从1到2有m条长度递减的路,这岂不是要入队m次…… cpp include include include include using namespace std; struct Edge{ int too, nxt, val; }e 阅读全文
摘要:
```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 阅读全文