結果

問題 No.1210 XOR Grid
コンテスト
ユーザー Navier_Boltzmann
提出日時 2023-04-07 22:16:46
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 127 ms / 2,000 ms
+ 690µs
コード長 453 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 71 ms
コンパイル使用メモリ 81,280 KB
実行使用メモリ 146,016 KB
最終ジャッジ日時 2026-09-09 04:54:12
合計ジャッジ時間 10,632 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 57
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline


N,M,X = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
mod = 10**9 + 7
ta = 0
tb = 0
for a in A:
    ta ^= a
for b in B:
    tb ^= b
if ta!=tb:
    print(0)
    exit()

if min(N,M)==1:
    print(1)
    exit()

S = pow(2,X,mod)
ans = pow(S,(N-1)*(M-1),mod)
print(ans)
0