2016 Dec Silver Problem 3 Moocast

From Wiki
Jump to navigation Jump to search

Problem

In this problem, Farmer John's N cows (1≤N≤200) are setting up an emergency "moo-cast" system to broadcast important messages among themselves. They use walkie-talkies with varying transmission power P. The walkie-talkies can only transmit to other cows within a distance of P, and cows can relay messages along multiple hops.

Due to the asymmetrical nature of the walkie-talkie transmission, broadcasts from some cows may be more effective at reaching a larger number of recipients. The goal is to determine the maximum number of cows that can be reached by a broadcast originating from a single cow, considering the relaying of messages.

Solution

Code