結果

問題 No.1870 Xor Matrix
コンテスト
ユーザー horitaka1999
提出日時 2022-03-11 23:50:09
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 317 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 316 ms
コンパイル使用メモリ 85,376 KB
実行使用メモリ 120,448 KB
最終ジャッジ日時 2026-04-05 08:44:24
合計ジャッジ時間 2,789 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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