#P2099. [NOI2007] 调兵遣将

    ID: 2969 远端评测题 3000ms 500MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>2007NOI 系列提交答案Special JudgeO2优化

[NOI2007] 调兵遣将

Output Format

The first line of each output file contains the time TT your solution takes.

Then output TT lines. In order, output each command. Each line contains 44 integers x1,y1,x2,y2x_1, y_1, x_2, y_2, indicating moving the squad located at (x1,y1)(x_1, y_1) to (x2,y2)(x_2, y_2).

5 5
..##.
#...#
#OOO#
#..O#
.###.
1
2 1 2 2

Hint

If the contestant’s output plan is invalid (overlapping squads during execution, squads moving out of the rectangular boundary, squads occupying research regions in the final plan, research regions not surrounded, etc.), the score is zero.

Otherwise, let the time spent by the contestant’s plan be ansans, and the score is computed as follows:

$$score= \begin{cases} \ 10&ans \leq A_i\\ \ 1+\left\lfloor\dfrac{ans-B_i}{A_i-B_i}\right\rfloor \times 9&A_i<ans \leq B_i\\ \ 1&B_i<ans\\ \end{cases}$$

For each dataset, there are two scoring parameters AiA_i and BiB_i, with Ai<BiA_i < B_i guaranteed.

Translated by ChatGPT 5