toTournament

Read a tournament from one-liner string.

Input line must be a sequence of non-negative integers separated by white spaces, which start with numbers of tables, players, and rounds. The following (players * rounds) numbers are interpreted as the tables at which players play in the rounds of the tournament.

  1. Tournament toTournament(string x)
    pure
    toTournament
    (
    string x
    )
  2. Tournament toTournament(string[] x)

Examples

toTournament("1 5 5 [1 0 0 0 0] [0 1 0 0 0] [0 0 1 0 0] [0 0 0 1 0] [0 0 0 0 1]") (brackets for explanation) is a trivial tournament played by one table with 5 players. Each section in the brackets is a round, each element of which is the number of the table each player plays at.

Meta