摘要: Luogu P3367 1 #include <bits/stdc++.h> 2 3 using namespace std; 4 5 const int MAXN = 2e5; 6 7 int fa[MAXN]; 8 9 int find(int x) { 10 return fa[x] == x 阅读全文
posted @ 2018-08-22 11:40 zhylj 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Splay(Tyvj 1728/Bzoj 3224 普通平衡树) 1 #include <bits/stdc++.h> 2 3 using namespace std; 4 5 struct node { 6 int data, size, cnt; 7 node *child[2], *fathe 阅读全文
posted @ 2018-08-22 06:48 zhylj 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 树状数组: 1 #include <bits/stdc++.h> 2 3 using namespace std; 4 5 const int MAXN = 5e5 + 5; 6 7 struct binit { 8 int a[MAXN], n; 9 void modify(int x, int 阅读全文
posted @ 2018-08-22 06:46 zhylj 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Dinic: 1 #include <bits/stdc++.h> 2 3 using namespace std; 4 5 const int MAXN = 1e5 + 5, inf = 0x7f7f7f7f; 6 7 struct edge { 8 int to, nxt, cap; 9 } e 阅读全文
posted @ 2018-08-22 06:43 zhylj 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 优先队列优化的Dijkstra: 1 #include <bits/stdc++.h> 2 3 using namespace std; 4 5 const int MAXN = 5e5 + 5, inf = 0x3f3f3f3f; 6 7 struct point { 8 int id, dis; 阅读全文
posted @ 2018-08-22 06:42 zhylj 阅读(127) 评论(0) 推荐(0) 编辑