結果

問題 No.2663 Zero-Sum Submatrices
ユーザー 👑 ygussanyygussany
提出日時 2024-02-18 09:08:25
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 779 bytes
コンパイル時間 844 ms
コンパイル使用メモリ 29,824 KB
実行使用メモリ 17,268 KB
最終ジャッジ日時 2024-03-08 20:30:23
合計ジャッジ時間 2,183 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,676 KB
testcase_01 AC 1 ms
6,676 KB
testcase_02 AC 1 ms
6,676 KB
testcase_03 AC 1 ms
6,676 KB
testcase_04 AC 1 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 AC 1 ms
6,676 KB
testcase_07 AC 1 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 1 ms
6,676 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 1 ms
6,676 KB
testcase_12 AC 1 ms
6,676 KB
testcase_13 AC 2 ms
6,676 KB
testcase_14 AC 2 ms
6,676 KB
testcase_15 AC 2 ms
6,676 KB
testcase_16 AC 2 ms
6,676 KB
testcase_17 AC 1 ms
6,676 KB
testcase_18 AC 2 ms
6,676 KB
testcase_19 AC 2 ms
6,676 KB
testcase_20 AC 1 ms
6,676 KB
testcase_21 AC 2 ms
6,676 KB
testcase_22 AC 1 ms
6,676 KB
testcase_23 AC 1 ms
6,676 KB
testcase_24 AC 1 ms
6,676 KB
testcase_25 AC 2 ms
6,676 KB
testcase_26 AC 1 ms
6,676 KB
testcase_27 AC 2 ms
6,676 KB
testcase_28 AC 3 ms
10,100 KB
testcase_29 AC 3 ms
10,100 KB
testcase_30 AC 5 ms
17,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

const int bit[21] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576};

int check(int n, int m, int A[][2048])
{
	int i, j, ii, jj;
	for (i = 0; i < n; i++) {
		for (ii = i + 1; ii < n; ii++) {
			for (j = 0; j < m; j++) {
				for (jj = 0; jj < m; jj++) if ((A[i][j] ^ A[i][jj] ^ A[ii][j] ^ A[ii][jj]) != 0) return 0;
			}
		}
	}
	return 1;
}

int main()
{
	int n, m;
	scanf("%d %d", &n, &m);
	
	int i, j, k, A[2048][2048];
	for (i = 0, k = 0; i < bit[n]; i++) for (j = 0; j < bit[m]; j++) A[i][j] = k++;
	// printf("%d\n", check(n, m, A));
	for (i = 0; i < bit[n]; i++) {
		for (j = 0; j < bit[m] - 1; j++) printf("%d ", A[i][j]);
		printf("%d\n", A[i][j]);
	}
	fflush(stdout);
	return 0;
}
0