Diary (2020暑期集训日记&总结)
2020.08 2020.8.15 Splay 第一次在blog里粘代码 每天一棵 \(Splay\) 好一个调解心情 #include <iostream> #include <cstring> #include <cstdio> #include <algorithm> #define debug puts("hs") using namespace std; inline int read(){ int x = 0, w = 1; char ch; for(; ch > '9' || ch < '0'; ch = getchar()) if(ch == '-') w = -1; for(; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - '0'; return x * w; } const int ss = 100010; const int inf = 0x7fffffff; struct node{ int son[2]; int size, num, val, fa; }tr[ss << 1]; int root, cnt; inline void update(int x){ tr[x].size = tr[tr[x].son[0]].size + tr[tr[x].son[1]].size + tr