跳到正文

题解

题目 P9091

存档题解 1 篇按获赞排序

在洛谷打开

题解

  1. 0 赞

    题解 P9091 【「SvR-2」Let's Meet at a Higher Place】

    令人遗憾的是本题唯一赛时通过者 @Silver187 写的是经过大力卡常后的算法三。 算法一 容易发现前缀 gcd 的限制相当于 forall 2 ≤ i ≤ m, b_i mid b_i - 1。 枚举 b_1 后记忆化搜索即可。时间复杂度为 O(nm^2 log n),可以通…