1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #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; } |
0 of 5 Questions completed
Questions:
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
0 of 5 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
1处应填( )
2处应填( )
3处应填( )
4处应填( )
5处应填( )