結果

問題 No.1870 Xor Matrix
ユーザー shobonvipshobonvip
提出日時 2022-03-11 23:10:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 410 ms / 2,000 ms
コード長 609 bytes
コンパイル時間 794 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 150,496 KB
最終ジャッジ日時 2023-10-14 08:26:30
合計ジャッジ時間 8,054 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,348 KB
testcase_01 AC 64 ms
71,488 KB
testcase_02 AC 63 ms
71,260 KB
testcase_03 AC 257 ms
116,128 KB
testcase_04 AC 392 ms
145,092 KB
testcase_05 AC 268 ms
115,760 KB
testcase_06 AC 307 ms
125,856 KB
testcase_07 AC 351 ms
135,048 KB
testcase_08 AC 354 ms
138,500 KB
testcase_09 AC 245 ms
110,572 KB
testcase_10 AC 312 ms
124,492 KB
testcase_11 AC 351 ms
138,204 KB
testcase_12 AC 363 ms
132,080 KB
testcase_13 AC 218 ms
105,092 KB
testcase_14 AC 394 ms
142,724 KB
testcase_15 AC 222 ms
105,748 KB
testcase_16 AC 245 ms
111,200 KB
testcase_17 AC 410 ms
150,496 KB
testcase_18 AC 314 ms
128,264 KB
testcase_19 AC 357 ms
140,780 KB
testcase_20 AC 281 ms
117,684 KB
testcase_21 AC 188 ms
99,460 KB
testcase_22 AC 265 ms
115,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
mod = 998244353

ar = [[0 for i in range(20)] for j in range(n)]
br = [[0 for i in range(20)] for j in range(m)]

for i in range(n):
	for j in range(20):
		ar[i][j] = (a[i] >> j) & 1

for i in range(m):
	for j in range(20):
		br[i][j] = (b[i] >> j) & 1

ans = 1
for i in range(20):
	atmp = 0
	btmp = 0
	for j in range(n):
		atmp += ar[j][i]
	for j in range(m):
		btmp += br[j][i]
	#print(atmp, btmp, n-atmp, m-btmp)
	if (atmp + btmp) % 2 == 1:
		ans = 0
	ans = ans * pow(2, n*m-n-m+1, mod) % mod
	
print(ans)
0