結果

問題 No.1870 Xor Matrix
ユーザー wolgnik
提出日時 2022-03-11 22:04:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 286 bytes
コンパイル時間 186 ms
コンパイル使用メモリ 82,792 KB
実行使用メモリ 105,856 KB
最終ジャッジ日時 2024-09-16 02:21:23
合計ジャッジ時間 3,175 ms
ジャッジサーバーID
(参考情報)
judge6 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
N, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
mod = 998244353

xor = 0
for x in a: xor ^= x
for x in b: xor ^= x

if xor:
  print(0)
  exit(0)

print(pow(1 << 20, N * M - (N + M - 1), mod))
0