結果

問題 No.1870 Xor Matrix
コンテスト
ユーザー hir355
提出日時 2022-03-11 22:14:08
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 112 ms / 2,000 ms
コード長 401 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 192 ms
コンパイル使用メモリ 84,864 KB
実行使用メモリ 122,240 KB
最終ジャッジ日時 2026-04-05 06:25:51
合計ジャッジ時間 2,669 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

MOD = 998244353
n, m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 1
for i in range(20):
    cx = 0
    cy = 0
    for x in a:
        if (x >> i) & 1:
            cx ^= 1
    for x in b:
        if (x >> i) & 1:
            cy ^= 1
    if cx != cy:
        print(0)
        exit(0)
    ans *= pow(2, (n - 1) * (m - 1), MOD)
print(ans % MOD)
0