結果

問題 No.1870 Xor Matrix
ユーザー 👑 KazunKazun
提出日時 2022-03-11 21:34:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 312 bytes
コンパイル時間 648 ms
コンパイル使用メモリ 87,240 KB
実行使用メモリ 107,764 KB
最終ジャッジ日時 2023-10-14 06:26:53
合計ジャッジ時間 4,312 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,584 KB
testcase_01 AC 70 ms
71,388 KB
testcase_02 AC 71 ms
71,376 KB
testcase_03 AC 104 ms
99,012 KB
testcase_04 AC 119 ms
100,380 KB
testcase_05 AC 102 ms
99,904 KB
testcase_06 AC 110 ms
101,532 KB
testcase_07 AC 117 ms
102,316 KB
testcase_08 AC 113 ms
99,960 KB
testcase_09 AC 97 ms
94,744 KB
testcase_10 AC 111 ms
103,852 KB
testcase_11 AC 115 ms
99,512 KB
testcase_12 AC 116 ms
107,764 KB
testcase_13 AC 95 ms
93,300 KB
testcase_14 AC 120 ms
102,508 KB
testcase_15 AC 93 ms
92,384 KB
testcase_16 AC 99 ms
95,796 KB
testcase_17 AC 122 ms
99,860 KB
testcase_18 AC 110 ms
101,220 KB
testcase_19 AC 116 ms
100,628 KB
testcase_20 AC 110 ms
100,088 KB
testcase_21 AC 94 ms
90,084 KB
testcase_22 AC 104 ms
98,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def xor(A):
    x=0
    for a in A:
        x^=a
    return x

def solve(N,M,A,B):
    if xor(A)!=xor(B):
        return 0

    alpha=2**20
    return pow(alpha,(N-1)*(M-1),Mod)

N,M=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))

Mod=998244353

print(solve(N,M,A,B))
0