№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3857 |
2 | jiangly | 3747 |
3 | orzdevinwang | 3706 |
4 | jqdai0815 | 3682 |
5 | ksun48 | 3591 |
6 | gamegame | 3477 |
7 | Benq | 3468 |
8 | Radewoosh | 3463 |
9 | ecnerwala | 3451 |
10 | heuristica | 3431 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | -is-this-fft- | 162 |
3 | Dominater069 | 159 |
3 | Qingyu | 159 |
5 | atcoder_official | 157 |
6 | Um_nik | 154 |
7 | adamant | 151 |
7 | djm03178 | 151 |
7 | luogu_official | 151 |
10 | awoo | 147 |
Название |
---|
First of all, since gcd(x, p) divides p, we have i+kx == j (mod gcd(x, p)). What is i+kx (mod gcd(x, p))? kx is divisible by gcd(x, p), so i+kx becomes just i. We got i == j (mod gcd(x, p)).
But how you are so sure that if I+kx is congruent to j in mod p, the same congruency will be followed in mod gcd(x,p)?
Hi! Consider this: let us have two numbers a, b that are congruent modulo p (a == b (mod p)). Then, a + kp = b. Now let's take both sides modulo some number q, which is a divisor of p. We get a+kp == b (mod q); here, kp is just 0 modulo q, so a == b (mod q). We conclude that, in general, if two numbers are congruent modulo p, they are also congruent modulo any divisor of p (including gcd(p, x)).
ur prooving $$$\Rightarrow$$$ not $$$\Leftrightarrow$$$
i + kx = pn + j (let say where n is any integer) => i = j + (pn — kx) Now, we know gcd(x, p) can be written as ax + bp (here , a = -k and b = n).
thanks!