问题 3051 --矩阵变幻(完善程序)

3051: 矩阵变幻(完善程序)★★★

时间限制: 1 Sec  内存限制: 128 MB
提交: 517  解决: 447
[提交][状态][命题人:]

题目描述

#include<cstdio>
using namespace std;
int n;
const int max_size=1<<10;
int res[max_size][max_size];
void recursive(int x,int y,int n,int t)
{
    if(n==0)
    {
        res[x][y]=_____(1)_____;
        return;
    }
    int step=1<<(n-1);
    recursive(_____(2)______,n-1,t);
    recursive(x,y+step,n-1,t);
    recursive(x+step,y,n-1,t);
    recursive(______(3)______,n-1,!t);
}
int main()
{
    scanf("%d",&n);
    recursive(0,0,______(4)_____);
    int size=______(5)______;
    for(int i=0;i<size;++i)
    {
        for(int j=0;j<size;++j)
        printf("%d",res[i][j]);
        puts("");
    }
    return 0;
}

输入

输出

样例输入
Copy
3
样例输出
Copy
00000000 
01010101 
00110011 
01100110 
00001111 
01011010 
00111100 
01101001 

提示

来源

[提交][状态]