結果

問題 No.1870 Xor Matrix
ユーザー titiatitia
提出日時 2022-03-11 23:17:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,025 ms / 2,000 ms
コード長 417 bytes
コンパイル時間 232 ms
コンパイル使用メモリ 10,884 KB
実行使用メモリ 31,060 KB
最終ジャッジ日時 2023-10-14 08:34:40
合計ジャッジ時間 10,200 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,824 KB
testcase_01 AC 14 ms
8,216 KB
testcase_02 AC 13 ms
7,964 KB
testcase_03 AC 714 ms
21,520 KB
testcase_04 AC 123 ms
27,620 KB
testcase_05 AC 701 ms
27,084 KB
testcase_06 AC 219 ms
21,696 KB
testcase_07 AC 103 ms
23,908 KB
testcase_08 AC 1,025 ms
27,484 KB
testcase_09 AC 95 ms
21,452 KB
testcase_10 AC 875 ms
28,780 KB
testcase_11 AC 967 ms
29,616 KB
testcase_12 AC 113 ms
31,060 KB
testcase_13 AC 71 ms
18,624 KB
testcase_14 AC 124 ms
26,124 KB
testcase_15 AC 584 ms
18,812 KB
testcase_16 AC 654 ms
19,556 KB
testcase_17 AC 126 ms
30,580 KB
testcase_18 AC 848 ms
23,204 KB
testcase_19 AC 135 ms
26,296 KB
testcase_20 AC 101 ms
22,288 KB
testcase_21 AC 454 ms
18,944 KB
testcase_22 AC 695 ms
23,508 KB
権限があれば一括ダウンロードができます

ソースコード

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

for i in range(30):
    ac=0
    bc=0

    for a in A:
        if a & (1<<i) != 0:
            ac+=1

    for b in B:
        if b & (1<<i) != 0:
            bc+=1

    if ac%2!=bc%2:
        print(0)
        exit()

ANS=pow(pow(2,(N-1)*(M-1),mod),20,mod)
print(ANS)
0