Atcoder ARC-070
A
可以发现的是,次数的下界一定是使得 \(\frac{n(n + 1)}{2} \ge X\) 最小的 \(n\)。
稍加思考可以发现,只需要在某一时刻停一下一定能在下界的次数内跳到恰好 \(X\)。
因此最小的时间就是使得 \(\frac{n(n + 1)}{2} \ge X\) 最小的 \(n\),解方程可得 \(n_{min} = \lceil \frac{\sqrt{8x + 1} - 1}{2} \rceil\)
B
click here to read the solution
C
click here to read the solution