banner
NEWS LETTER

余数定理 | OI笔记

Scroll down

余数加法定理

(a + b) % c = (a % c + b % c) % c

证明:

a = xc + p, b = yc + q
a % c = p, b % c = q

则有:
(a + b) % c = [(x + y)c + p + q] % c = (p + q) % c
(a % c + b % c) % c = (p + q) % c

余数乘法定理

(a * b) % c = (a % c * b % c) % c

证明

a = xc + p, b = yc + q

同余定理

a和b同余:a ||| b

Other Articles
cover
贪心 | OI笔记
  • 22/12/21
  • 09:04
  • 信息竞赛
cover
STL进阶 | OI笔记
  • 22/11/15
  • 18:40
  • 信息竞赛
Please enter keywords to search