数论。
如果$x$不唯一,假设存在两个解,较大的为${x_1}$,较小的为${x_2}$。
那么,
$\left\{ {\begin{array}{*{20}{c}}
{ {x_1}\% {c_i} = {x_2}\% {c_i}}\\{ {x_1}\% k \ne {x_2}\% k}\end{array}} \right. \Rightarrow \left\{ {\begin{array}{*{20}{c}}{({x_1} - {x_2})\% {c_i} = 0}\\{({x_1} - {x_2})\% k \ne 0}\end{array}} \right.$。$∵lcm({c_1},{c_2},{c_3},......,{c_n})\% {c_i} = 0$
$∴lcm({c_1},{c_2},{c_3},......,{c_n})\% ({x_1} - {x_2}) = 0$
$∵({x_1} - {x_2})\% k \ne 0$
$∴lcm({c_1},{c_2},{c_3},......,{c_n})\% k \ne 0$
也就是说:如果解不唯一,那么$lcm({c_1},{c_2},{c_3},......,{c_n})\% k \ne 0$。
换句话说就是:如果解唯一,那么$lcm({c_1},{c_2},{c_3},......,{c_n})\% k = 0$。
#pragma comment(linker, "/STACK:1024000000,1024000000")#include#include #include #include #include #include