/* -*- coding: utf-8 -*- * * 2663.cc: No.2663 Zero-Sum Submatrices - yukicoder */ #include #include using namespace std; /* constant */ /* typedef */ /* global variables */ /* subroutines */ /* main */ int main() { int n, m; scanf("%d%d", &n, &m); int h = 1 << n, w = 1 << m; for (int i = 0, a = 0; i < h; i++) for (int j = 0; j < w; j++, a++) printf("%d%c", a, (j + 1 < w) ? ' ' : '\n'); return 0; }