版本比较
线段树分治学习笔记 & P3206 题解
正文
增加 3 行删除 3 行
34 行未改动35363738394041424385 行未改动129130131132133134135136137131 行未改动全部展开26927027127227327427534 行未改动```cpp#include <cstdio>#include <cstring>#include <algorithm>#include <stack>#include <queue>#include <vector>#define int long longusing namespace std;85 行未改动void makeroot(int k){access(k);splay(k);flip(k);}int getroot(int k){access(k);splay(k);for(;tr[k][0];pushdown(k),k=tr[k][0]);131 行未改动全部展开for(int i=2;i<=q+1;i++){printf("%lld\n",res[i]);}return 0;}```(写得太臭,不吸氧过不了……大概是LCT本身常数大的缘故)34 行未改动35363738394041424385 行未改动129130131132133134135136137131 行未改动全部展开26927027127227327427534 行未改动```cpp#include <cstdio>#include <cstring>#include <algorithm>#include <stack>#include <queue>#include <vector>#define int long longusing namespace std;85 行未改动void makeroot(int k){access(k);splay(k);flip(k);}int getroot(int k){access(k);splay(k);for(;tr[k][0];pushdown(k),k=tr[k][0]);131 行未改动全部展开for(int i=2;i<=q+1;i++){printf("%lld\n",res[i]);}return 0;}```(写得太臭,不吸氧过不了……大概是LCT本身常数大的缘故)