|
|||||||||||||||||||
|
SPOJ time: 2012-02-09 05:32:31 |
All Sets SequenceProblem code: HS09SSEQ
You are given N sets of positive integers. You are to write a program that finds a sequence of integers S such that:
InputInput starts with an integer (1 <= N <= 500), the number of sets. N lines follow, each describing a set in the following manner: an integer (1 <= L <= 100), representing the size of the set and L space separated integers. Sets will be composed of integers from the closed interval [0, 99]. OutputIn the first line of output, print the sequence S in the same manner of the sets. The second line of output must consist of N space separated integers, with the i-th integer being the zero-indexed initial position of a subword containing the i-th set. ScoringYou will get max(0, SOL-M) points for a single test, where SOL is the sum of lengths of all sets and M is the length of the printed sequence. The number of points displayed in the ranking is scaled so that it is equal to 10 for the registered contestant whose solution has the highest score, and proportionally less for all solutions with lower scores. ExampleInput: Notes
|
||||||||||||||||||
| |||||||||||||||||||