In this problem the number of integers points on a segment is gcd(x,y)+1. where x = abs(x1-x2) and y = abs(y1-y2). But why it does? Anyone please explain it. Thanks in advance.
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
Help please!![GCD problem]
In this problem the number of integers points on a segment is gcd(x,y)+1. where x = abs(x1-x2) and y = abs(y1-y2). But why it does? Anyone please explain it. Thanks in advance.
Rev. | Язык | Кто | Когда | Δ | Комментарий | |
---|---|---|---|---|---|---|
en3 | Muhammad_mhs | 2020-05-22 22:28:12 | 1 | Tiny change: 'of integers points on' -> 'of integer points on' | ||
en2 | Muhammad_mhs | 2020-05-22 22:27:23 | 1 | Tiny change: 'gers point on a segm' -> 'gers points on a segm' | ||
en1 | Muhammad_mhs | 2020-05-22 22:26:52 | 256 | Initial revision (published) |
Название |
---|