Изменения рейтингов за последние раунды временно удалены. Скоро они будут возвращены. ×

Блог пользователя tensaida

Автор tensaida, история, 5 лет назад, По-английски

i've been solving this problem for a day now https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=6&page=show_problem&problem=380 can someone pls check my code?? i did a bfs and it worked, but a dfs is not working forsomereason my code: https://pastebin.com/HbnZdZMH

Полный текст и комментарии »

  • Проголосовать: нравится
  • -3
  • Проголосовать: не нравится

Автор tensaida, история, 5 лет назад, По-английски

I've been trying to solve this problem.

Here's my approach: I used Dijkstra, where W(u, v) is the minimum number of orders required to get from the starting vertex to v. To find out if I needed an order at a vertex, I maintained a set of "available" vertices from a given vertex (i.e. outdegree), removing a vertex once it's explored.

Here's my solution.

All help is appreciated!

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится