Please read the new rule regarding the restriction on the use of AI tools. ×

v3318384's blog

By v3318384, history, 4 hours ago, In English

Nasarallah is a treasure hunter exploring a vast cave filled with tunnels. The cave system can be represented as a tree with N nodes (cave rooms) and N-1 edges (tunnels). Each tunnel has a certain weight that represents the time it takes to travel between two rooms.

Nasarallah starts in room 1, and his goal is to collect treasure hidden in different rooms of the cave. Each room has either zero or one treasure. Nasarallah can only carry one treasure at a time, so he needs to pick up the treasure from one room, return to room 1, and repeat this process for all rooms with treasure.

Given the structure of the cave, your task is to help Nasarallah minimize the total time spent collecting all the treasures and returning them to room 1.

  • Vote: I like it
  • -24
  • Vote: I do not like it