用树剖的全re,吸了氧全ac

P3398 仓鼠找 sugar

树剖思路就很简单,直接给一路径值加上1,然后查询另外一路径的权值和是否大于0,最后把加上1的路径减掉1以恢复状态。
by Butane @ 2022-01-21 23:17:24


出现UB了罢
by ztx__ @ 2022-01-22 08:24:37


[UB](https://blog.csdn.net/dragonboss2016/article/details/79612782)
by ztx__ @ 2022-01-22 08:25:38


@[ztxcsl](/user/125018) 谢谢大佬!原来是这样,不过我太菜了,还是看不出来是哪行代码属于UBQAQ。检查了一下好像没有除0、越界访问或者其他UB问题
by Butane @ 2022-01-22 08:52:56


@[ronghuo](/user/403799) 我太菜了没有看出来QAQ
by ztx__ @ 2022-01-22 09:07:18


@[ztxcsl](/user/125018) 谢谢大佬!
by Butane @ 2022-01-22 09:17:51


``` #define int long long ``` 去了
by _Passerby_ @ 2023-12-09 21:12:18


|