@[Phrvth](/user/520544) 你拿个build函数模拟一下,统计一下最大的p,然后输出,对一对
by char_cha_ch @ 2022-08-22 12:55:25
@[kirihara233](/user/701221) 我试下
by Phrvth @ 2022-08-22 12:56:58
@[Phrvth](/user/520544)
出个馊主意/cy
https://www.acwing.com/problem/content/4585/
这题程序跑一下
by expnoi @ 2022-08-22 12:56:59
@[small_rubbish](/user/378346) 我记得有一道题,就在洛谷,一道蓝题,就是有点这个意思
by char_cha_ch @ 2022-08-22 12:58:35
@[kirihara233](/user/701221)
我试过了,$5*10^5$是$1050000$小一点
by Phrvth @ 2022-08-22 13:00:53
我看题解都开了4倍的$n$
by Phrvth @ 2022-08-22 13:01:17
* 当 $\log_2 n$ 为整数时,结点数为 $2n-1$ 个节点
* 当 $\log_2 n$ 不为整数时,结点数为 $4 \times 2^{\left\lfloor{\log_2 n}\right\rfloor}-1$
$\because \left\lfloor{\log_2 n}\right\rfloor < \log_2 n$
$\therefore 4 \times 2^{\left\lfloor{\log_2 n}\right\rfloor}-1 < 4n-1 < 4n$
~~从自己博客copy过来的(~~
by q779 @ 2022-08-22 13:01:50
@[Phrvth](/user/520544) 我记得线段树模板提有个秀儿,说这个题开三倍,说明了线段树到底开多少是个谜(((
by char_cha_ch @ 2022-08-22 13:03:15
@[kirihara233](/user/701221) 考场实在不行就跑跑build吧
by Phrvth @ 2022-08-22 13:05:56
@[Phrvth](/user/520544) 啊确实,但不过直接开个4倍最保险
by char_cha_ch @ 2022-08-22 13:06:26