結果

問題 No.1210 XOR Grid
ユーザー 👑 rin204
提出日時 2022-10-30 17:08:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 162 ms / 2,000 ms
コード長 304 bytes
コンパイル時間 203 ms
コンパイル使用メモリ 82,420 KB
実行使用メモリ 133,028 KB
最終ジャッジ日時 2024-07-07 08:26:33
合計ジャッジ時間 9,381 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 57
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10 ** 9 + 7

n, m, x = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

def f(A):
    ret = 0
    for a in A:
        ret ^= a
    return ret

if f(A) != f(B):
    print(0)
else:
    ans = pow(pow(2, x, MOD), (n - 1) * (m - 1), MOD)
    print(ans)
0