Tap here to switch tabs
Problem
Submissions

Problem: Maximum Xor Product

Try to solve the Maximum Xor Product problem.

Statement

Given three integers a, b, and n, find an integer x satisfying 0≤0 \leq x <2n< 2^n such that the product (a XOR x) * (b XOR x) is maximized.

Return the maximum possible product modulo 109+710^9 + 7.

Constraints:

  • 0≤0 \leq a, b <250< 2^{50}

  • 0≤0 \leq n ≤50\leq 50

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Xor Product

Try to solve the Maximum Xor Product problem.

Statement

Given three integers a, b, and n, find an integer x satisfying 0≤0 \leq x <2n< 2^n such that the product (a XOR x) * (b XOR x) is maximized.

Return the maximum possible product modulo 109+710^9 + 7.

Constraints:

  • 0≤0 \leq a, b <250< 2^{50}

  • 0≤0 \leq n ≤50\leq 50