卡常方法
- 快速读入。
int read() {
int x = 0, f = 1;
char ch = getchar_unlocked();
for(; ch < '0' || ch > '9'; ch = getchar_unlocked()) {
if(ch == '-') {
f = -1;
}
}
for(; ch >= '0' && ch <= '9'; ch = getchar_unlocked()) {
x = (x << 3) + (x << 1) + ch - '0';
}
return x * f;
}
对于一些数据结构。
李超线段树。
加入一条边时判断这条边会不会被中间的边完全替代。
把加入边时的递归改成循环。