結果

問題 No.1142 XOR と XOR
ユーザー rlangevinrlangevin
提出日時 2023-11-20 12:06:38
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 492 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 114,472 KB
最終ジャッジ日時 2023-11-20 12:07:26
合計ジャッジ時間 47,254 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
59,248 KB
testcase_01 AC 40 ms
59,248 KB
testcase_02 AC 40 ms
59,248 KB
testcase_03 TLE -
testcase_04 TLE -
testcase_05 AC 1,922 ms
111,720 KB
testcase_06 TLE -
testcase_07 TLE -
testcase_08 TLE -
testcase_09 TLE -
testcase_10 TLE -
testcase_11 AC 42 ms
59,248 KB
testcase_12 AC 40 ms
59,248 KB
testcase_13 AC 40 ms
59,248 KB
testcase_14 AC 1,601 ms
102,920 KB
testcase_15 AC 1,542 ms
104,288 KB
testcase_16 AC 164 ms
75,680 KB
testcase_17 TLE -
testcase_18 AC 513 ms
81,256 KB
testcase_19 TLE -
testcase_20 AC 1,537 ms
102,728 KB
testcase_21 AC 978 ms
90,648 KB
testcase_22 AC 558 ms
81,952 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 AC 1,476 ms
101,228 KB
testcase_26 TLE -
testcase_27 AC 1,941 ms
111,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N2 = 1 << 10
def f(X):
    ans = [0] * N2
    pre = [0] * N2
    for i in range(len(X)):
        dp = [0] * N2
        dp[X[i]] = 1
        for j in range(N2):
            dp[j] += pre[j ^ X[i]]
            ans[j] += dp[j]
        pre, dp = dp, pre
    return ans

N, M, K = map(int, input().split())
mod = 10 ** 9 + 7
A = list(map(int, input().split()))
B = list(map(int, input().split()))
DA, DB = f(A), f(B)
ans = 0
for i in range(N2):
    ans += DA[i] * DB[i^K]
    ans %= mod

print(ans)
0