結果

問題 No.1210 XOR Grid
ユーザー ああいい
提出日時 2022-01-10 13:51:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 278 bytes
コンパイル時間 380 ms
コンパイル使用メモリ 82,084 KB
実行使用メモリ 132,772 KB
最終ジャッジ日時 2024-11-14 10:51:37
合計ジャッジ時間 9,082 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 35 WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

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

a = 0
for i in A:
    a ^= i
b = 0
for i in B:
    b ^= i
if a != b:
    print(-1)
else:
    P = 10 ** 9 + 7
    t = pow(2,X,P)
    ans = pow(t,(N-1)*(M-1),P)
    print(ans)
0