結果

問題 No.1142 XOR と XOR
ユーザー 👑 rin204rin204
提出日時 2022-07-10 17:26:26
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 479 bytes
コンパイル時間 357 ms
コンパイル使用メモリ 82,292 KB
実行使用メモリ 116,228 KB
最終ジャッジ日時 2024-04-25 16:52:01
合計ジャッジ時間 32,675 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
59,156 KB
testcase_01 AC 41 ms
59,088 KB
testcase_02 AC 43 ms
60,544 KB
testcase_03 TLE -
testcase_04 AC 1,600 ms
110,556 KB
testcase_05 AC 1,332 ms
111,948 KB
testcase_06 AC 1,684 ms
110,060 KB
testcase_07 TLE -
testcase_08 TLE -
testcase_09 TLE -
testcase_10 TLE -
testcase_11 AC 43 ms
58,868 KB
testcase_12 AC 43 ms
58,560 KB
testcase_13 AC 43 ms
58,816 KB
testcase_14 AC 1,183 ms
104,024 KB
testcase_15 AC 1,124 ms
105,288 KB
testcase_16 AC 125 ms
67,080 KB
testcase_17 AC 1,591 ms
110,280 KB
testcase_18 AC 405 ms
79,756 KB
testcase_19 AC 1,686 ms
111,216 KB
testcase_20 AC 1,027 ms
103,756 KB
testcase_21 AC 750 ms
91,440 KB
testcase_22 AC 404 ms
82,592 KB
testcase_23 AC 1,585 ms
109,904 KB
testcase_24 AC 1,771 ms
110,460 KB
testcase_25 AC 1,103 ms
101,888 KB
testcase_26 AC 1,702 ms
107,872 KB
testcase_27 AC 1,390 ms
111,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10 ** 9 + 7

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

def f(A):
    cnt = [0] * 1024
    cnt2 = [0] * 1024
    cnt2[0] = 1
    xor = 0
    for a in A:
        xor ^= a
        for k in range(1024):
            cnt[xor ^ k] += cnt2[k]
            cnt[xor ^ k] %= MOD
        cnt2[xor] += 1
    return cnt

A = f(A)
B = f(B)
ans = 0
for i in range(1024):
    ans += A[i] * B[i ^ k]
    ans %= MOD
print(ans)
0