JYTS @ 2018-10-26 20:10:52
本垃圾打这个板子题打了一晚上???
Hint:在线段树query中加一句话
if(l>r)return 0;
滚了滚了本垃圾滚了
by Juan_feng @ 2018-10-26 20:12:27
(似乎没加也A了
by Everlasting_Snow @ 2018-10-26 20:13:53
然鹅有没有人解答一下Query on a tree spoj 过而洛谷TLE啊QωQ
by JYTS @ 2018-10-26 20:14:14
没加的边界处理很优秀,但本垃圾不一样
by King_of_gamers @ 2018-10-26 20:15:35
@fengsongquan 震惊!出现了!冯神仙!
by Everlasting_Snow @ 2018-10-26 20:16:35
, , , , , ,
周神仙再装弱就要被雷劈辣
by sleepyNick @ 2018-10-26 20:17:39
这种写法多妙哇
void update (int now, int tl, int tr, int L, int R, int change) {
if (R < tl || tr < L)return;
if (L <= tl && tr <= R) {
tree[now] += (tr-tl+1) * change;
lazy[now] += change; return;
}
pushdown (now, tl, tr);
int mid = (tl+tr) >> 1;
update (now << 1, tl, mid, L, R, change);
update (now << 1 | 1, mid+1, tr, L, R, change);
pushup (now);
}
by sleepyNick @ 2018-10-26 20:18:21
@大帅哥就是ME 话说此题不是裸树剖嘛QAQ
by EDT_ @ 2018-10-26 20:22:47
不是个人写法问题吗qwq
by 顾z @ 2018-10-26 20:23:57
@大帅哥就是ME 没必要啊,
要不是没看到题里面的x=y输出0我就切了
by JYTS @ 2018-10-27 13:49:40
被一群人嘲讽溜了