为什么块对奇偶排序反而慢

P4462 [CQOI2018] 异或序列

@[GKxx](/space/show?uid=72071) 奇偶排序是理论复杂度会快一倍,但是不代表它一定比普通排序快,上次我就被卡了。
by Sai0511 @ 2018-10-03 00:54:28



by hpbl @ 2018-10-03 07:06:48


应该是你的莫队比较呆@[GKxx](/space/show?uid=72071)
by EMT__Mashiro @ 2018-12-07 11:01:41


这是奇偶性不开O2的: https://www.luogu.org/record/show?rid=14463034 总时间975ms,最慢的166ms。 这是直接排不开O2的: https://www.luogu.org/recordnew/show/14463107 总时间1376ms,最慢的275ms。 哪个快哪个慢应该很明显了吧。 (奇偶性排序开了O2之后能跑到330ms)
by EMT__Mashiro @ 2018-12-07 11:05:43


@[EMT__Mashiro](/space/show?uid=89875) 我觉得我不仅莫队比较呆,我写啥都呆... 人傻自带大常数说的就是我了
by GKxx @ 2018-12-07 17:14:23


@[GKxx](/space/show?uid=72071) 发下代码看看,其实注意一下开register,inline就可以了。(莫队简单的add等操作可以define掉,这样就可以把Ans开register了)
by EMT__Mashiro @ 2018-12-07 19:42:49


|