-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDCP.cpp
72 lines (67 loc) · 1.96 KB
/
DCP.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// __________________
// | ________________ |
// || ____ ||
// || /\ | ||
// || /__\ | ||
// || / \ |____ ||
// ||________________||
// |__________________|
// \\#################\\
// \\#################\\
// \ ____ \
// \_______\___\_______\
// An AC a day keeps the doctor away.
#pragma GCC optimize("Ofast")
#pragma loop_opt(on)
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define debug(x) (cerr<<#x<<" = "<<(x)<<'\n')
#define all(v) begin(v),end(v)
#define siz(v) (ll(v.size()))
#define get_pos(v,x) (lower_bound(all(v),x)-begin(v))
#define pb emplace_back
#define ff first
#define ss second
#define mid (l+(r-l>>1))
using namespace std;
using namespace __gnu_pbds;
typedef int64_t ll;
typedef long double ld;
typedef pair<ll,ll> pll;
template <typename T> using rkt = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
constexpr ld PI = acos(-1), eps = 1e-9;
constexpr ll N = 1000025, INF = 1e18, MOD = 998244353, K = 899153;
constexpr inline ll cdiv(ll x, ll m) { return (x+m-1)/m; } // ceiling divide, x/m for flooring divide
template <typename T> void M(T &x, ll m = MOD){x%=m; if(x<0) x+=m;}
// splay tree
struct splay_tree {
int pa[N],sz[N],ch[2][N];
bool isroot(int x){return ch[0][pa[x]]!=x && ch[1][pa[x]]!=x;}
bool ori(int x){
assert(!isroot(x));
if(ch[0][pa[x]] == x) return 0;
if(ch[1][pa[x]] == x) return 1;
}
void init(int n) { for(int i = 1; i <= n; i++) pa[i] = i, sz[i] = 1; }
void rot(int &x,bool d) {
int y = x;
x = ch[!d][y], ch[!d][y] = ch[d][x], ch[d][x] = y;
}
void splay(int x) {
while(!isroot(x)) {
int y = pa[x];
if(!isroot(y))
}
}
};
struct ETT{
};
struct dynamic_connectivity {
void addEdge(int x,int y);
void cutEdge(int x,int y);
bool isconnect(int x,int y);
};
signed main() {
//LCT
}