Codeforces и Polygon могут быть недоступны в период с 23 мая, 7:00 (МСК) по 23 мая, 11:00 (МСК) в связи с проведением технических работ. ×

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

Автор Mysterious109, история, 11 месяцев назад, По-английски

Hi, I made a graph problem that I couldn't solve and I was wondering if it's solvable at all, so I'd appreciate if someone solved it (doesn't have to be solvable in the given constraints just any solution).

given a rooted weighted tree made of $$$n$$$ nodes you start from the root and go to any adjacent node you are given $$$m$$$ resturants each one will be on a node you are required to print the minimum cost to visit $$$k$$$ different resturants (you can visit an edge more than once)

$$$1\le n \le 10^5$$$, $$$m \le n$$$, $$$k \le m$$$, $$$1 \le cost \le 10^9$$$

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

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