Carcassone X87657


Statement
 

pdf   zip

html

Input The input is divided into 3 parts as follows:

  1. The first line of the input data contains a number N with the total number of players (N > 0).
  2. The following lines represent the main game phase where the features are being completed during the players’ turns. These lines are composed by the player number that got the feature, the feature type, and only in case the feature is city or road, the number of tiles to calculate the proper points. In this phase we will apply the main scoring rules.
    At the end of players’ turns, when there are no tiles remaining, all the incomplete features are scored. This final phase is indicated with a colon “:” symbol in a new line.
  3. The following lines represent the final game phase. Now we the non-completed features and also the fields gained by players can be scored. These lines contain, as those above, a similar structure, but in this case the cloisters have a third parameter that indicates the surrounding tiles and the third parameter of the fields indicates the amount of bordering cities. Now the final scoring rules applies instead. And finally the “.” symbol indicates the end of input data lines.

Output

Public test cases
  • Input

    4
    1 city 4
    2 cloister
    3 road 3
    :
    1 field 2
    3 road 6
    4 cloister 1
    .
    

    Output

    Player[1] -> 14
    Player[2] -> 9
    Player[3] -> 9
    Player[4] -> 2
    
  • Information
    Author
    HP CodeWars
    Language
    English
    Official solutions
    C++
    User solutions
    C++ Python