CRT
CRT 是用来解决一元线性同余方程组的。
例如,对于下面的方程组:
{ x ≡ a 1 ( m o d m 1 ) x ≡ a 2 ( m o d m 2 ) ⋯ ⋯ x ≡ a n ( m o d m n ) \begin{cases}x\equiv a_1\;(\,\mathrm {mod}\; m_1)\\ x\equiv a_2\;(\,\mathrm {mod}\; m_2)\\ \;\;\;\;\;\;\;\;\;\cdots\cdots \\ x\equiv a_n\;(\,\mathrm {mod}\; m_n) \end{cases} ⎩
⎨
⎧x≡a1(modm1)x≡a2(modm2)⋯⋯x≡an(modmn)
其中, m 1 , m 2 , . . . , m n m_1,m_2,...,m_n m1,m2,...,mn 是两两互质的整数。
我们令 m = ∏ i = 1 n m i m=\prod\limits_{i=1}^nm_i m=i=1∏nmi<