結果

問題 No.1870 Xor Matrix
ユーザー hir355hir355
提出日時 2022-03-11 22:14:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 182 ms / 2,000 ms
コード長 401 bytes
コンパイル時間 261 ms
コンパイル使用メモリ 87,088 KB
実行使用メモリ 107,608 KB
最終ジャッジ日時 2023-10-14 07:23:50
合計ジャッジ時間 4,712 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,552 KB
testcase_01 AC 71 ms
71,324 KB
testcase_02 AC 72 ms
71,432 KB
testcase_03 AC 153 ms
99,772 KB
testcase_04 AC 124 ms
100,428 KB
testcase_05 AC 154 ms
101,008 KB
testcase_06 AC 137 ms
101,576 KB
testcase_07 AC 120 ms
102,344 KB
testcase_08 AC 182 ms
99,976 KB
testcase_09 AC 110 ms
95,524 KB
testcase_10 AC 165 ms
103,904 KB
testcase_11 AC 177 ms
99,480 KB
testcase_12 AC 121 ms
107,608 KB
testcase_13 AC 101 ms
93,800 KB
testcase_14 AC 127 ms
102,520 KB
testcase_15 AC 137 ms
93,352 KB
testcase_16 AC 148 ms
96,652 KB
testcase_17 AC 128 ms
100,292 KB
testcase_18 AC 168 ms
101,232 KB
testcase_19 AC 128 ms
100,724 KB
testcase_20 AC 116 ms
100,776 KB
testcase_21 AC 128 ms
91,292 KB
testcase_22 AC 155 ms
99,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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