https://www.luogu.com.cn/paste/pwa8ga4e
链接放错了(
by lxyt_415x @ 2024-04-17 10:27:02
@[lxyt_415x](/user/734487) 叻
by DanhengYinyue @ 2024-04-17 10:33:50
@[lxyt_415x](/user/734487)
这题莫队会卡常,块长应该为 `len=2*n/sqrt(m)+1` 吧
by lunjiahao @ 2024-04-17 11:18:31
@[lunjiahao](/user/779970)
```len=(n<<1)/sqrt(m);```
这里啊
by lxyt_415x @ 2024-04-17 11:22:14
@[lxyt_415x](/user/734487)
块长没写错,那就加点优化吧
1. `inline` 和 `register`
2. 位运算优化,例如 `if(x==y)` 改为 `if(x^y)`,`swap(x,y);` 改为 `x^=y^=x^=y;`
3. 开数组需要时间,所以开多少用多少,例如 `fa[21][N]` 即可,`N=6e5+10` 2倍空间就够用了
(暂时想不到还有别的)
by lunjiahao @ 2024-04-17 11:31:38
@[lunjiahao](/user/779970)
upd代码 + TLE on ```#7```
by lxyt_415x @ 2024-04-17 12:00:08
由于此题的变量名与其他题略有不同,再加上我是唐诗,所以在莫队排序时用颜色区间排的序
此贴结
也许可以变成一个警示后人贴?
~~不过真的有人会犯这错吗~~
by lxyt_415x @ 2024-04-18 21:15:33