QOJ.ac

QOJ

时间限制: 1 s 内存限制: 512 MB 总分: 100

#2598. 排列矩阵

统计

给定一个正整数 $n$。请构造一个 $2^n \times 2^n$ 的矩阵,使得:

  • 该矩阵包含从 $1$ 到 $2^{2n}$ 的互不相同的正整数。
  • 所有大小为 $2^{n-1} \times 2^{n-1}$ 的子矩阵的元素之和相等。

子矩阵是指原矩阵中一个连续的矩形区域。

输入格式

第一行包含一个整数 $n$ ($1 \le n \le 10$)。

输出格式

在第一行输出 “YES”(如果存在满足条件的矩阵)或 “NO”(如果不存在)。 如果存在,在接下来的 $2^n$ 行中打印该矩阵,每行包含 $2^n$ 个用空格分隔的整数。

样例

输入 1

1

输出 1

NO

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.