C. 战俘的命运

    Type: Default 1000ms 256MiB

战俘的命运

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

现有 2n×2n(n10)2^n\times 2^n (n\le10) 名战俘站成一个正方形方阵等候 将军的发落。将军 决定赦免一些战俘。他将正方形矩阵均分为 4 个更小的正方形矩阵,每个更小的矩阵的边长是原矩阵的一半。其中左上角那一个矩阵的所有战俘都将得到赦免,剩下 3 个小矩阵中,每一个矩阵继续分为 4 个更小的矩阵,然后通过同样的方式赦免战俘……直到矩阵无法再分下去为止。所有没有被赦免的战俘都将被处罚。

给出 nn,请输出每名战俘的命运,其中 0 代表被赦免,1 代表不被赦免。

输入格式

一个整数 nn

输出格式

2n×2n2^n \times 2^n 的 01 矩阵,代表每个人是否被赦免。数字之间有一个空格。

样例 #1

样例输入 #1

3

样例输出 #1

0 0 0 0 0 0 0 1
0 0 0 0 0 0 1 1
0 0 0 0 0 1 0 1
0 0 0 0 1 1 1 1
0 0 0 1 0 0 0 1
0 0 1 1 0 0 1 1
0 1 0 1 0 1 0 1
1 1 1 1 1 1 1 1

scp-j模拟赛2023.6

Not Attended
Status
Done
Rule
OI
Problem
4
Start at
2023-7-31 10:45
End at
2023-7-31 20:45
Duration
3 hour(s)
Host
Partic.
6