传送门 [PR #1]删数 题意:写的很清楚了,略 思路: 首先转化为差分数组,两个连续数相同,删掉,乘二放进去. 发现能互相转化的两个数,符号,值\(/lowbit\)都一样. 把能相互转化的数归为一类,处理出每个的lowbit,能除\(2\)的次数. \(f_i\)表示前\(i\)个最终的数的数量. 枚举第\(i\)最后为\(2^j\),想要知道多少到\(i\)可以变为\(2^j\). 考虑到两个\(2^j\)凑出\(2^{j+1}\)这个可以倍增处理已知右端点\(i\),合并后值为\(2^…