시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 (추가 시간 없음) | 1024 MB | 181 | 157 | 143 | 85.629% |
This problem deals with a simplified version of a game called “Mind”. In this game, a group tries to cooperatively solve a problem. Assume:
The objective of the game is for all the players to put all the cards down in sorted order (in the real game, players do not see their own cards, hence the name for the game – Mind). Given the cards in each hand, you are to provide the order for the players to place their cards down.
The first input line contains an integer, p (2 ≤ p ≤ 6), indicating the number of players. Each of the following p input lines provides the cards for one player. Each line starts with an integer, c (1 ≤ c ≤ 9), indicating the number of cards for that player; the count is followed by the cards in sorted order (each card between 10 and 99, inclusive).
Print the order for the players to place down the cards so that the cards are in order.
2 3 10 40 50 2 20 30
ABBAA
3 4 40 51 60 70 3 12 32 42 5 20 53 80 90 95
BCBABACAACCC