#P16205. 「o.OI R-1 EX」雷同题

    ID: 18222 远端评测题 10000ms 512MiB 尝试: 0 已通过: 0 显示难度NOI/NOI+/CTS 上传者: 标签>提交答案Special JudgeO2优化

「o.OI R-1 EX」雷同题

Background

(The problem provider is True154.)

Please submit using the “submit answer” method to prevent your solution from being stolen.

On December 8, 2005, the United Nations General Assembly announced that April 4 each year would be set as the International Day for Mine Awareness and Assistance in Mine Action (full name: International Day for Mine Awareness and Assistance in Mine Action).

This day aims to raise public awareness of the humanitarian threats caused by landmines, explosive remnants of war, and improvised explosive devices, and to encourage countries to strengthen their mine action capabilities.

The flea frog country has always taken flea frog humanitarianism as its foundation, regarding the protection of civilians and the healing of war trauma as its duty. In response to the international call, the flea frog country has decided to form a team with both solid knowledge of landmines and rich mine-clearing experience. At present, four-by-seven selection problems closely centered on the Minesweeper theme are ready. Who will stand out in this selection? Let us wait and see.

Problem Description

For each 0k270 \le k \le 27, you need to place as few mines as possible in the cube with coordinates x,y,z[0,n+1]x,y,z \in [0,n+1], such that for any x,y,z[1,n]x,y,z \in [1,n], if (x,y,z)(x,y,z) is not a mine, then among the 2626 positions adjacent to it, there are exactly kk mines.

Here, two coordinates are called “adjacent” if the difference of each coordinate is at most 11. It is guaranteed that n=55\bm{n=55}.

In this problem, you need to directly use one program to output the constructions for k=0k=0 to k=27k=27 in order. See 【Output Format】 for details.

Input Format

Input an integer nn, guaranteed n=55n=55.

Output Format

Output the constructions for k=0,,27k=0,\cdots,27 in order.

For each kk, output (n+2)(n+2) square matrices of size (n+2)(n+2) rows and (n+2)(n+2) columns. From top to bottom, they represent the mine layout in your construction. * denotes a mine, and . denotes empty space. Do not output extra blank lines.

55
***********************************************
***********************************************
(还有 90970 行长度为 57 的全 '*' 串,样例写不下)

Hint

Sample Explanation

In the sample output, all positions are mines, which is a valid output.

According to the scoring rules, pip_i is the number of empty cells, which is 00.

The total score is 00.

Scoring Rules

Define pi(0i27)p_i(0 \le i \le 27) as:

  • If your construction for k=ik=i is valid, then pip_i is the number of empty cells.

  • If your construction for k=ik=i is invalid, then pi=0p_i=0.

Your score is i=027pi\sum_{i=0}^{27} p_i.

If you do not know how to construct for some kk, you still need to output any layout in the required format.

You need to achieve a total score of at least 29700002970000 in this problem to be considered as passing.

The highest score on-site was 29380952938095, and the current sum of the highest scores at all points is 29781552978155.

Checker

After downloading the additional file, there is a line inside:

freopen("1.out","r",stdin);

1.out is your answer output file, and the checker will read from this file.

If the output format is incorrect, it returns Wrong answer.

Otherwise, you will get the total score, as well as the validity and score for k=0,,27k=0,\cdots,27.

Translated by ChatGPT 5