結果

問題 No.1870 Xor Matrix
ユーザー shobonvipshobonvip
提出日時 2022-03-11 23:10:20
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 669 bytes
コンパイル時間 559 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 150,588 KB
最終ジャッジ日時 2023-10-14 08:25:50
合計ジャッジ時間 9,032 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,416 KB
testcase_01 AC 72 ms
71,552 KB
testcase_02 AC 72 ms
71,436 KB
testcase_03 AC 323 ms
116,200 KB
testcase_04 WA -
testcase_05 AC 308 ms
115,584 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 394 ms
138,104 KB
testcase_09 WA -
testcase_10 AC 358 ms
124,428 KB
testcase_11 AC 379 ms
138,228 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 261 ms
105,656 KB
testcase_16 AC 283 ms
111,040 KB
testcase_17 WA -
testcase_18 AC 356 ms
128,476 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 220 ms
99,584 KB
testcase_22 AC 303 ms
115,660 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 == 0 or btmp == 0 or n-atmp == 0 or m-btmp == 0:
		if (atmp + btmp) % 2 == 1:
			ans = 0
	ans = ans * pow(2, n*m-n-m+1, mod) % mod
	
print(ans)
0