Public Judge

pjudge

満点: 7 出力のみ

#21894. 【PER #4】Zack vs. Pencil-and-Paper Puzzles

統計

This is an answer-submission problem.

This is a problem that Zha-ke battled for half an hour during IOI 2024 training.

There is a rectangle divided into an $n \times n$ grid. You need to color some of the cells black, subject to the following requirements:

  • No two black cells can share a common edge.
  • The set of non-black cells must be 4-connected.

Find the maximum number of cells that can be colored black.

Implementation Details

You do not need to submit a program; you only need to submit your constructed answer.

There are 7 test cases in this problem, each worth 1 point, for a total of 7 points.

Input

An integer $n$.

Output

$n$ lines, each containing a binary string of length $n$, where $1$ represents a black cell and $0$ represents a non-black cell.

Examples

Input 1

5

Output 1

10101
00000
10101
00000
10101

Constraints

There are 7 test cases in total, with $n$ equal to $300, 301, 302, 303, 304, 305, 306$ respectively.

For each $n$, let $a_n$ be the number of black cells in the optimal solution, and $b_n$ be the number of black cells in your answer.

If $b_n = a_n$, you will receive 1 point. Otherwise, you will receive 0 points.


またはファイルを一つずつアップロード:

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.