Can any please help me resolve this? I have tried, iostream/stdin, nothing seems to work. https://codeforces.me/contest/1504/submission/111973501.
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3839 |
3 | Radewoosh | 3646 |
4 | jqdai0815 | 3620 |
4 | Benq | 3620 |
6 | orzdevinwang | 3612 |
7 | Geothermal | 3569 |
7 | cnnfls_csy | 3569 |
9 | ecnerwala | 3494 |
10 | Um_nik | 3396 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | Um_nik | 164 |
2 | maomao90 | 160 |
3 | -is-this-fft- | 159 |
4 | atcoder_official | 158 |
4 | awoo | 158 |
4 | cry | 158 |
7 | adamant | 155 |
8 | nor | 154 |
9 | TheScrasse | 153 |
10 | maroonrk | 152 |
Can any please help me resolve this? I have tried, iostream/stdin, nothing seems to work. https://codeforces.me/contest/1504/submission/111973501.
Merry Christmas Everyone!
A problem from Div2 (237) C. Restore Graph asks to construct a graph when distances from a vertex are given.
The solutions and editorial to this problem indicate that we should be searching for nodes that are at dist[u] + 1
for a given node u and there should at least be one such node. But if we have distances = [0, 1, 4]
, then a tree like this 1-(1)->2-(3)->3
also satisfies the conditions in the question and there is no node at a distance of 2
from 1
. Can anyone please help he understand what am I missing here?
Thanks in advance!
Название |
---|