結果

問題 No.1142 XOR と XOR
ユーザー NoneNone
提出日時 2021-02-27 18:17:04
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 573 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 82,268 KB
実行使用メモリ 109,056 KB
最終ジャッジ日時 2024-04-10 15:47:11
合計ジャッジ時間 4,622 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
59,136 KB
testcase_01 AC 39 ms
54,016 KB
testcase_02 AC 42 ms
60,032 KB
testcase_03 AC 168 ms
107,760 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(A):
    a0=0
    P=defaultdict(int)
    AA=defaultdict(int)
    for a in A:
        a0^=a
        for p,val in P.items():
            AA[a0^p]+=val
            AA[a0^p]%=MOD
        P[a0]+=1
        AA[a0]+=1
    return AA

import sys
input = sys.stdin.readline
from  collections import defaultdict
MOD=10**9+7
N,M,K=map(int, input().split())
A=list(map(int, input().split()))
B=list(map(int, input().split()))

A=f(A)
B=f(B)
cnt=0
for a,val_a in A.items():
    for b,val_b in B.items():
        if a^b==K:
            cnt+=val_a*val_b
            cnt%=MOD
print(cnt)
0