結果
| 問題 | No.1210 XOR Grid |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-04-07 22:16:46 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 164 ms / 2,000 ms |
| コード長 | 453 bytes |
| コンパイル時間 | 300 ms |
| コンパイル使用メモリ | 82,340 KB |
| 実行使用メモリ | 132,460 KB |
| 最終ジャッジ日時 | 2024-10-02 19:46:05 |
| 合計ジャッジ時間 | 9,680 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 57 |
ソースコード
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)