CSSA's most handsome president Chang Cailou is also a perfectionist. He has developed a new game mode for his special Tetris game, and hopes you can help him test this new mode.
In the new mode, the special Tetris game screen has 8 rows and 9 columns. Every second, a block will fall until it reaches the bottom or rests on another stationary block.
Initially, there will be some stationary blocks. Then a block will be placed, consisting of a 3x3 grid, with (X, Y) being the coordinates of the top-left corner. It is guaranteed that there is enough empty space for the block to be placed.
After placement, K operations will be performed.
If a movement would cause collision with a stationary block or go beyond the game screen, the move is illegal and should be ignored. The block will not become stationary.
Finally, output the game screen after K operations.
'*'
represents the placed block'#'
represents stationary blocks that have stopped'.'
represents position where no block has appeared yet
For sample input (RLRR):
This problem is a partial judge.
Please implement functions defined in the header file.
Initially, there is an 8x9 two-dimensional array representing the initial game screen.
The next line contains two integers X, Y, indicating the coordinates (X, Y) of the top-left corner of the 3x3 grid where a block will be placed.
Following this is a 3×3 grid using '*'
to represent cells with blocks and '.'
to represent empty cells, showing the block's shape. Each placed block is guaranteed not to split.
The last line contains an integer K, representing the number of operations.
The next K lines each contain one operation:
Output the game screen after K operations: