結果

問題 No.1210 XOR Grid
ユーザー ああいい
提出日時 2022-01-10 13:52:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 150 ms / 2,000 ms
コード長 277 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 82,200 KB
実行使用メモリ 133,152 KB
最終ジャッジ日時 2024-11-14 10:51:44
合計ジャッジ時間 6,912 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 57
権限があれば一括ダウンロードができます

ソースコード

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(0)
else:
    P = 10 ** 9 + 7
    t = pow(2,X,P)
    ans = pow(t,(N-1)*(M-1),P)
    print(ans)
0