P27277 [AtCoder] Seven-in-a-Row
提高-
题目描述

Problem Description

There is a $9 \times 9$ grid, initially all squares are painted white.

You want to paint as few squares black as possible to ensure that no white squares form a continuous sequence of 7 squares in any direction (vertical, horizontal, or diagonal).

Output one such way of painting the squares.

Input Format

There is no input for this problem.

Output Format

Output one $9 \times 9$ grid that satisfies the conditions described in the problem. Note that . represents a white square and # represents a black square.

Be careful that if your output is not a $9 \times 9$ grid or contains characters other than these two and newline characters, it may be considered incorrect.

Sample Input and Output

Sample Input #1

None

Sample Output #1

#########
#########
#########
#########
#########
#########
#########
#########
#########

Sample Input #2

None

Sample Output #2

.#.#.#.#.
#.#.#.#.#
.#.#.#.#.
#.#.#.#.#
.#.#.#.#.
#.#.#.#.#
.#.#.#.#.
#.#.#.#.#
.#.#.#.#.

Notes/Hints

Partial Points

This problem has partial points. The scoring is as follows:

  • If the output grid contains no sequences of 7 continuous white squares in any direction, it is judged as Accepted, and you are awarded $floor(200 / max(1, N - 10))$ points, where $N$ is the number of black squares in the output.
  • Otherwise, it is judged as Wrong Answer, and no points are awarded.
  • Note that for system reasons, if you earn $X$ points with an Accepted solution, all previously submitted Accepted solutions that earned less than $X$ points will be counted as wrong answers and will incur penalties.

Sample Explanation 1

Since there are no white squares, there are no sequences of 7 continuous white squares. If you submit this grid, you will be awarded 2 points.

Sample Explanation 2

In this board, there are sequences of 7 continuous white squares diagonally, so if you submit it, it will be judged as Wrong Answer, and no points will be awarded.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输出
######### ######### ######### ######### ######### ######### ######### ######### #########