Məsələlər
Ford-Bellman
Первый тест такой же, как в условии???
awpris cavab verdi:
Нет
Есть ли какие-либо требования к переводам строки/пробелам в выводе?
awpris cavab verdi:
Да.
Если иное не оговорено в условии, то наличие лидирующих и концевых пробелов запрещено, а перевод строки обязателен.
Can anyone tell what's special about test 2? Many people seem to get wrong answer on it.
I guess there are vertexes such that the way from vertex 1 to those doesn't exist and there are ages between that vertexes with negative weight. If you use Bellman–Ford algorithm after relaxation the distance to some of those vertexes are less then initial infinity value, but there are still not way from vertex 1 to those. Example of test that demonstrate my point is: 3 1 2 3 -1