結果

問題 No.1210 XOR Grid
コンテスト
ユーザー shotoyoo
提出日時 2020-08-30 16:09:12
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 230 ms / 2,000 ms
+ 774µs
コード長 675 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 65 ms
コンパイル使用メモリ 81,472 KB
実行使用メモリ 304,280 KB
最終ジャッジ日時 2026-09-23 03:49:10
合計ジャッジ時間 11,459 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 57
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n,m,x = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
M = 10**9+7
def sub(a,b):
    xa = 0
    xb = 0
    for num in a:
        xa ^= num
    for num in b:
        xb ^= num
    if xa!=xb:
        return 0
    else:
        return pow(2,len(a)*len(b)-(len(a)+len(b))+1,M)
ans = 1
for i in range(x):
    res = sub([(item>>i)&1 for item in a], [(item>>i)&1 for item in b])
    if res == 0:
        ans = 0
        break
    else:
        ans *= res
        ans %= M
print(ans)
0