您从来没有见过这么菜的东西对不对。没错我就是这么菜。实在对不起玷污了您的眼睛。

OI 中经常遇到有关下取整和上取整的运算,这些公式手推很容易,但是对我这种菜鸡来说非常容易出错并且需要耗时,因此不如把他们记住。

\(a,b,m\) 为正整数:

\[\lfloor\frac{a}{b}\rfloor=\lceil\frac{a+1}{b}\rceil-1,\lceil\frac{a}{b}\rceil=\lfloor\frac{a-1}{b}\rfloor+1 \]

\[ab\ge m\Leftrightarrow a\ge\lceil\frac{m}{b}\rceil\Leftrightarrow b\ge\lceil\frac{m}{a}\rceil \]

\[ab\gt m\Leftrightarrow a\gt\lfloor\frac{m}{b}\rfloor\Leftrightarrow b\gt\lfloor\frac{m}{a}\rfloor \]

\[ab\le m\Leftrightarrow a\le\lfloor\frac{m}{b}\rfloor\Leftrightarrow b\le\lfloor\frac{m}{a}\rfloor \]

\[ab\lt m\Leftrightarrow a\lt\lceil\frac{m}{b}\rceil\Leftrightarrow b\lt\lceil\frac{m}{a}\rceil \]

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-17
  • 2022-12-23
  • 2021-08-11
  • 2021-12-27
  • 2022-12-23
猜你喜欢
  • 2021-08-02
  • 2021-11-21
  • 2021-10-12
  • 2022-01-15
  • 2021-05-24
  • 2022-12-23
相关资源
相似解决方案