为什么这东西MLE了?

P2633 Count on a tree

题解开到1e7都没挂,不能理解。
by Masna_Kimoyo @ 2023-08-25 11:40:58


@[Masna_Kimoyo](/user/199459) 没离散化导致的
by czy0323 @ 2023-08-28 12:49:31


@[czy0323](/user/538427) 错了,是longlong没开导致的 值域线段树不需要离散化不知道吗
by Masna_Kimoyo @ 2023-08-28 12:54:25


@[Masna_Kimoyo](/user/199459) 感谢纠正
by czy0323 @ 2023-08-28 13:13:06


@[Masna_Kimoyo](/user/199459) 不过为什么没开long long会挂?
by czy0323 @ 2023-08-28 13:34:58


@[czy0323](/user/538427) 因为在代码里,有 (l+r)/2 这一行,但是l+r是有可能临时越界的
by Masna_Kimoyo @ 2023-08-28 13:57:20


|