1 solutions
-
2
#include<bits/stdc++.h> using namespace std; const int maxn = 1025, maxm = 11; int matchlist[maxn][maxn]; int m; int main() { scanf("%d", &m); int n = 1<<m, k = 1, half = 1; matchlist[0][0] = 1; while (k <= m) { for(int i = 0; i < half; i++) { for(int j = 0; j < half; j++) { matchlist[i][j + half] = matchlist[i][j] + half; } } for(int i = 0; i< half; i++) { for(int j = 0; j< half; j++) { matchlist[i + half][j] = matchlist[i][j + half]; matchlist[i + half][j + half] = matchlist[i][j]; } } half *= 2; k++; } for(int i = 0; i < n; i++) { for(int j = 0; j < n; j++) { printf("%d",matchlist[i][j]); } putchar('\n'); } return 0; }
- 1
Information
- ID
- 810
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 6
- Tags
- # Submissions
- 85
- Accepted
- 24
- Uploaded By