結果

問題 No.1870 Xor Matrix
ユーザー horitaka1999horitaka1999
提出日時 2022-03-11 23:50:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 317 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 86,900 KB
実行使用メモリ 107,660 KB
最終ジャッジ日時 2023-10-14 09:07:47
合計ジャッジ時間 4,205 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,240 KB
testcase_01 AC 73 ms
71,248 KB
testcase_02 AC 73 ms
71,164 KB
testcase_03 AC 109 ms
99,652 KB
testcase_04 AC 125 ms
100,320 KB
testcase_05 AC 111 ms
100,292 KB
testcase_06 AC 116 ms
101,744 KB
testcase_07 AC 119 ms
102,188 KB
testcase_08 AC 121 ms
99,776 KB
testcase_09 AC 103 ms
95,336 KB
testcase_10 AC 115 ms
103,888 KB
testcase_11 AC 120 ms
99,280 KB
testcase_12 AC 121 ms
107,660 KB
testcase_13 AC 101 ms
93,708 KB
testcase_14 AC 126 ms
102,448 KB
testcase_15 AC 101 ms
92,656 KB
testcase_16 AC 103 ms
96,408 KB
testcase_17 AC 129 ms
99,940 KB
testcase_18 AC 115 ms
101,136 KB
testcase_19 AC 121 ms
100,668 KB
testcase_20 AC 111 ms
100,636 KB
testcase_21 AC 97 ms
90,552 KB
testcase_22 AC 107 ms
98,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
s1 = A[0]
s2 = B[0]
mod = 998244353
for i in range(1,M):
    s1 ^= B[i]
for i in range(1,N):
    s2 ^= A[i]
if s1 == s2:
    tmp = pow(2,(N-1) * (M-1),mod)
    ans = pow(tmp,20,mod)
    print(ans)
else:
    print(0)
0