Hopping

CF1523H Hopping Around the Array

首先考虑 \(k = 0\) 的情况。 贪心,最后一步之前每个 \(i\) 只会跳到 \(j \in [i, i + a_i]\) 且 \(j + a_j\) 最大的点 \(j\),这个信息或许可以线性处理?但是我没脑子,我用线段树维护,时间复杂度 \(\mathcal O(n \log n)\)。 ......
Hopping Around 1523H Array 1523
共1篇  :1/1页 首页上一页1下一页尾页