#P7255. [BalticOI 2012] 俄罗斯方块 (Day2)

    ID: 8112 远端评测题 1000ms 128MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>2012提交答案Special JudgeBalticOI(波罗的海)

[BalticOI 2012] 俄罗斯方块 (Day2)

Problem Description

This is a game similar to Tetris. There are the following pieces in the game:

The game has a 9×99 \times 9 area. For each falling piece, you may choose the column where the leftmost block of this piece (the marked block in the picture) will fall. If the piece does not fit completely inside the area, the game ends. At that moment, if there is any row that is completely filled with blocks, all blocks in that row will be cleared, and the blocks above will move down accordingly.

There are NN pieces in total. You need to make as many pieces as possible fall successfully.

Note that in this game the pieces cannot be rotated.

Input Format

Please download the input file from the attachment.

The first line contains an integer NN, meaning there are NN pieces in the game.

The next NN lines each contain an integer, representing the index of the falling piece.

The testdata guarantees that a solution exists.

Output Format

For the input file, please submit the corresponding output file.

The output file contains at most NN lines. Each line contains an integer, indicating the column index where the leftmost block of that falling piece lands.

Hint

[Hint]

Each test point is worth 2020 points.

If you can make AA pieces fall normally, then you can get a score of AN\dfrac{A}{N} for that test point.

[Note]

Translated from BalticOI 2012 Day2 T3. Tiny.

Translated by ChatGPT 5