/*
*/
//#pragma comment(linker, "/STACK:16777216")
#define _CRT_SECURE_NO_WARNINGS
#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>
#include <memory.h>
#include <assert.h>
#define y0 sdkfaslhagaklsldk
#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash
#define eps 1e-8
#define M_PI 3.141592653589793
#define bs 1000000007
#define bsize 256
const int N = 1500000;
using namespace std;
vector<vector<int> > generate_board(int sz)
{
if (sz == 1)
{
vector<vector<int> > V;
V.resize(2);
V[0].resize(2);
V[1].resize(2);
V[0][1] = 1;
return V;
}
vector<vector<int> > temp = generate_board(sz - 1);
vector<vector<int> > res;
res.resize(temp.size()*2);
for (int i = 0; i < res.size(); i++)
{
res[i].resize(temp.size() * 2);
for (int j = 0; j < res[i].size(); j++)
{
if (i / temp.size() == j / temp.size())
res[i][j] = temp[i%temp.size()][j%temp.size()];
else
{
if (i == 0 && j == temp.size())
{
res[i][j] = 1;
}
else if (i == temp.size() && j == 0)
{
res[i][j] = 0;
}
else
{
res[i][j] = (i > j);
}
}
}
}
return res;
}
int main(){
//freopen("route.in","r",stdin);
//freopen("route.out","w",stdout);
//freopen("F:/in.txt", "r", stdin);
//freopen("F:/output.txt", "w", stdout);
ios_base::sync_with_stdio(0);
//cin.tie(0);
vector<vector<int> >board = generate_board(4);
cout << 16 << endl;
for (int i = 0; i < board.size(); i++)
{
for (int j = 0; j < board[i].size(); j++)
{
if (j)
cout << " ";
cout << board[i][j];
}
cout << endl;
}
cin.get(); cin.get();
return 0;
}
LyoKKi8KCi8vI3ByYWdtYSBjb21tZW50KGxpbmtlciwgIi9TVEFDSzoxNjc3NzIxNiIpCiNkZWZpbmUgX0NSVF9TRUNVUkVfTk9fV0FSTklOR1MKCiNpbmNsdWRlIDxmc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