結果

問題 No.1870 Xor Matrix
コンテスト
ユーザー hir355
提出日時 2022-03-11 22:14:08
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 137 ms / 2,000 ms
+ 77µs
コード長 401 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 232 ms
コンパイル使用メモリ 95,848 KB
実行使用メモリ 125,696 KB
最終ジャッジ日時 2026-08-28 10:17:26
合計ジャッジ時間 4,628 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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