#include<iostream>#include<cstdio>#include<cstring>#include<memory>usingnamespace std;int a[20][20], a1[20][20];int b[5][5];booldraw(int x,int y){memcpy(a1,a,sizeof(a1));//复制画布for(int i =0; i <4; i++)//用相对位置更新新板块在整体画布中的绝对位置{for(int j =0; j <4; j++){if(b[i][j]){int a = x + i, b = y + j;
a1[a][b]++;if(a1[a][b]==2)returntrue;}}}returnfalse;}intmain(){for(int i =0; i <15; i++)for(int j =0; j <10; j++)
cin >> a[i][j];for(int i =0; i <10; i++) a[15][i]=1;//设置一个墙 这样就不用特判了for(int i =0; i <4; i++)for(int j =0; j <4; j++)
cin >> b[i][j];int n;
cin >> n;
n--;//从0开始for(int i =0;;i++)//枚举时间{int x = i, y = n;if(draw(x, y)) //如果这个时刻碰到重复的了就重画上一时刻的画布{draw(x -1, y);break;}}for(int i =0; i <15; i++)//输出新的画布{for(int j =0; j <10; j++){
cout << a1[i][j]<<" ";}
cout << endl;}return0;}