結果

問題 No.1870 Xor Matrix
ユーザー rlangevinrlangevin
提出日時 2023-02-09 01:19:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 323 ms / 2,000 ms
コード長 410 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 87,256 KB
実行使用メモリ 241,596 KB
最終ジャッジ日時 2023-09-20 14:08:44
合計ジャッジ時間 7,457 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,500 KB
testcase_01 AC 75 ms
71,316 KB
testcase_02 AC 71 ms
71,356 KB
testcase_03 AC 237 ms
191,840 KB
testcase_04 AC 136 ms
109,572 KB
testcase_05 AC 323 ms
223,764 KB
testcase_06 AC 177 ms
156,484 KB
testcase_07 AC 128 ms
103,284 KB
testcase_08 AC 311 ms
238,804 KB
testcase_09 AC 117 ms
96,760 KB
testcase_10 AC 269 ms
212,404 KB
testcase_11 AC 308 ms
241,596 KB
testcase_12 AC 139 ms
107,528 KB
testcase_13 AC 115 ms
97,000 KB
testcase_14 AC 145 ms
110,724 KB
testcase_15 AC 195 ms
155,424 KB
testcase_16 AC 217 ms
172,088 KB
testcase_17 AC 140 ms
118,416 KB
testcase_18 AC 319 ms
213,148 KB
testcase_19 AC 145 ms
123,756 KB
testcase_20 AC 123 ms
100,624 KB
testcase_21 AC 195 ms
170,644 KB
testcase_22 AC 280 ms
178,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
mod = 998244353
for c in range(25):
    a, b = [], []
    for i in range(N):
        a.append( (A[i] >> c) & 1 )
    for j in range(M):
        b.append( (B[j] >> c) & 1 )
    b[0] ^= sum(a)%2
    if sum(b) % 2:
        print(0)
        exit()
        
ans = pow(2, (N - 1) * (M - 1) * 20, mod)
print(ans)
0