【发布时间】:2022-11-20 03:15:13
【问题描述】:
找到 X 使得 (A ^ X) * (B ^ X) 最大
给定 A、B 和 N (X < 2^N)
例子:
A = 4
B = 6
N = 3
We can choose X = 3 and (A ^ X) = 7 and (B ^ X) = 5.
The product will be 35 which is the maximum.
【问题讨论】:
-
乘积是对 2 的某个幂取模,还是“完整”乘积
-
乘积取模 10^9+7
-
好的,您自己的答案似乎没有考虑到这一点
-
是的,现在编辑了。
标签: bit-manipulation xor