安利下`pushdown`的写法
```cpp
int rt, tot;
int sz[N], ch[N][2];
// size 儿子
li s[N], mt[N], at[N];
// sum 乘tag 加tag
inline void ud(int x) {
s[x]=(s[ch[x][0]]+s[ch[x][1]])%p;
}
inline void ml(int x, li k) {
s[x] = s[x]*k%p, mt[x]=mt[x]*k%p, at[x]=at[x]*k%p;
}
inline void ad(int x, li k) {
s[x] = (s[x]+k*sz[x]%p)%p, at[x]=(at[x]+k)%p;
}
inline void ps(int x) {
if(mt[x]!=1) {
ml(ch[x][0], mt[x]);
ml(ch[x][1], mt[x]);
mt[x]=1ll;
}
if(at[x]!=0) {
ad(ch[x][0], at[x]);
ad(ch[x][1], at[x]);
at[x]=0ll;
}
}
```
by xwmwr @ 2020-06-10 22:15:25
芜湖,起飞!
by Ryo_Yamada @ 2020-06-10 22:17:30
芜湖,起飞!
by 1kri @ 2020-06-10 22:25:22
芜湖,起飞!
by SamariumPhosphide @ 2020-06-10 22:48:48
~~顺便吐槽一下pushdown难看的码风~~
by SamariumPhosphide @ 2020-06-10 22:49:18
芜湖,起飞!
by Smile_Cindy @ 2020-06-11 08:09:42
打破红紫名队列
by Smile_Cindy @ 2020-06-11 08:10:00
@[水比田昭寿](/user/118498) 谢谢qwq
by 芜湖起飞 @ 2020-06-11 21:50:07
@[Isaunoya](/user/96580) 谢谢qwq
by 芜湖起飞 @ 2020-06-11 21:50:22
感谢诸位抽空看了一眼我的代码
by 芜湖起飞 @ 2020-06-11 21:50:55