Skip to content

Commit

Permalink
Update sqrt-decomposition.md
Browse files Browse the repository at this point in the history
  • Loading branch information
TOMWT-qwq committed May 15, 2024
1 parent 736e082 commit 63470d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/math/number-theory/sqrt-decomposition.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ $$
当 $i=n$ 时,上式会出现分母为 $0$ 的错误,需要特殊处理。

??? note "证明"
$\left\lceil\dfrac ni\right\rceil=\left\lfloor\dfrac{n-1}i\right\rfloor+1$,可以发现 $n$ 的上取整分块与 $n-1$ 的下取整分块是一样的。$\rightline{\square}$
$\left\lceil\dfrac ni\right\rceil=\left\lfloor\dfrac{n-1}i\right\rfloor+1$,可以发现 $n$ 的上取整分块与 $n-1$ 的下取整分块是一样的。

???+ note " 例题:[CF1954E Chain Reaction](https://codeforces.com/contest/1954/problem/E)"
题意:有一排 $n$ 个怪兽,每个怪兽初始血量为 $a_i$,一次攻击会使一段连续的存活的怪兽血量减 $k$,血量不大于 $0$ 视作死亡,对于所有 $k$ 求出击杀所有怪兽所需攻击次数,$n,a_i\leq 10^5$。
Expand Down

0 comments on commit 63470d4

Please sign in to comment.