Thanks

Active In

International Olympiad in Informatics

2 replies. 1 discussion. Member

Artificial Intelligence

Member

Virtual Reality

Follower

Featured Contributions

discussion

Islands and Bridges

Lalit is in an amusement park. There are N islands in this park. These islands are connected with each other by bridges. For each pair of islands (a; b) there is exactly one way to go from a to b or vice versa. The bridges are of varying lengths. Lalit wants to traverse the paths between all possible pairs of vertexes. For example, if there are 4 vertexes numbered 1 to 4, he wants to go from 1 to 2, then from 1 to 3, then from 1 to 4, then from 2 to 3, then from 2 to 4, and finally from 3 to 4. Each time he starts a traversal, he buys an energy drink which gives him K units of energy. He must buy that drink for which K is at least equal to the length of the minimum bridge in the path he is going to traverse. The energy drink costs 1 unit of money per 1 unit of energy. So a drink with K units of energy will cost K units of money. Can you tell Lalit the minimum cost he will have to bear for completing this adventure.

**Input**

The rst line of input will contain an integer N, i.e., the number of islands.

The next N-1 lines will contain 3 space-separated in...

Read more…(313 words)

reply in this discussion

discussion

Islands and Bridges

Lalit is in an amusement park. There are N islands in this park. These islands are connected with each other by bridges. For each pair of islands (a; b) there is exactly one way to go from a to b or vice versa. The bridges are of varying lengths. Lalit wants to traverse the paths between all possible pairs of vertexes. For example, if there are 4 vertexes numbered 1 to 4, he wants to go from 1 to 2, then from 1 to 3, then from 1 to 4, then from 2 to 3, then from 2 to 4, and finally from 3 to 4. Each time he starts a traversal, he buys an energy drink which gives him K units of energy. He must buy that drink for which K is at least equal to the length of the minimum bridge in the path he is going to traverse. The energy drink costs 1 unit of money per 1 unit of energy. So a drink with K units of energy will cost K units of money. Can you tell Lalit the minimum cost he will have to bear for completing this adventure.

**Input**

The rst line of input will contain an integer N, i.e., the number of islands.

The next N-1 lines will contain 3 space-separated in...

Read more…(313 words)

discussion

Brackets (INOI 2016: India)

Indian National Olympiad in Informatics (INOI) is round 2 out of 3 (i.e. intermediate) for selection into Indian IOI team. See the discussion replies for ** solution one hint at a time** (credits: Arpan Bhattacharya)

Read more…(35 words)

reply in this discussion

About Hint 1100, you could change your description from a Hash table to memoization, just to be accurate.

Read more… (18 words)

Load More