Loading

摘要: 容易把问题转换为求前缀和。设 $p$ 为当前最大的下标使得 $a_p \leq x$,则容易得到答案: $$ \text{ans} = \sum_{i = 1}^{p}\left\lfloor\dfrac{x - a_p}{k}\right\rfloor $$ 比较难直接维护,所以稍微化简一下: $ 阅读全文
posted @ 2023-08-21 11:54 DE_aemmprty 阅读(25) 评论(0) 推荐(0)