Phylogenetic trees

One of the utilities of the trees is the classification of animal and
vegetal species.

(To see an instance, consult the pdf or ps version of this wording.)

Write a program that reads a classification of species, and that
afterwards for each given individual decides which specie belongs to. As
we do not have physical information of the individuals, we will use a
generator of pseudorandom numbers to choose for which branch of the
phylogenetic tree is necessary to go down until finding a leaf. As a
seed of the pseudorandom generator, for each given name we will use the
sum of its first character, of its second character multiplied by two,
of its third character multiplied by four, etc.

Input

Input consists of a general tree of words with the format explained at
the exercise REREG. Afterwards, the description of a generator of
pseudorandom numbers comes as is explained at the exercise CAMAL, except
that the initial seed s is not given (because it depens on each given
number). Finally, a series of names of indivuals are given.

Output

For each name of the input, your program must print wich specie it
belongs to following the format of the instance.

Observation

Choose between the r children of a node (even if r = 1) using the code
of the exercise GRAMA as it is given.

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T11:02:32.761Z

© Jutge.org, 2006–2026.
https://jutge.org
