結果

問題 No.1210 XOR Grid
コンテスト
ユーザー ntuda
提出日時 2025-11-25 14:17:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 188 ms / 2,000 ms
コード長 414 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 82,084 KB
実行使用メモリ 134,816 KB
最終ジャッジ日時 2025-11-25 14:17:25
合計ジャッジ時間 9,312 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 57
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

MOD = 10 ** 9 + 7
N,M,X = map(int,input().split())
A= list(map(int,input().split()))
B = list(map(int,input().split()))
if M == 1:
    N,M = M,N
    A,B = B,A
if N == 1:
    a = A[0]
    for b in B:
        a ^= b
    if a == 0:
        print(1)
    else:
        print(0)
    exit()
t1 = 0
for a in (A+B):
    t1 ^= a
if t1 == 0:
    ans = pow(pow(pow(2,N-1,MOD),M-1,MOD),X,MOD)
    print(ans)
else:
    print(0)
0