 A unique feature of ideas is that they are not consumed when used. A
good idea can benefit arbitrarily many people without diminishing the
value of the idea. An idea can even serve as the basis for creative
people to derive even better ideas. Each person relies on a specific
set of ideas to build on and create new ideas.
A unique feature of ideas is that they are not consumed when used. A
good idea can benefit arbitrarily many people without diminishing the
value of the idea. An idea can even serve as the basis for creative
people to derive even better ideas. Each person relies on a specific
set of ideas to build on and create new ideas.
In order to realize these benefits, ideas need to be communicated to the people who use them. People have developed an extensive worldwide communication network to satisfy this need. The network is composed of a series of tubes connecting people. The tubes are inhabited by curious creatures called packets which carry ideas from one person to another. In order to avoid collisions between packets, the tubes are all unidirectional. Each person can have zero or more incoming and zero or more outgoing tubes.
All of the packets start at the same person, and each packet follows the following algorithm:
The input data is such that it is possible for a packet to reach every person from person 0, and whenever a person P relies on a given idea, every path a packet could have taken to reach P will have visited at least one person who created that idea. It is possible for more than one person to independently create the same idea.
To ease the strain on each packet, you would like to minimize the number of ideas that it remembers at any given time by directing the packet to forget certain ideas in certain tubes. However, in so doing, you must ensure that no matter what path the packet takes, every time it visits a person, the packet knows all of the ideas that the person needs.
1 3 3 2 1 1 0 0 1 0 1 1 2 2 1
1 0 1