正文
增加 2 行删除 2 行
4 行未改动56789101112131415161712 行未改动4 行未改动### 题意题目描述清晰,不多讲述。### 结论$\forall s=t$,都有 $ans=0$。$\forall s,t \in [0,2^n)$ 且 $s \ne t$,都有 $ans=(s\oplus(2^n-1))+(t\oplus(2^n-1))$,其中 $ans$ 为最终的代价。### 证明若 $s = t$,那么答案为 $0$。若 $s\ne t$,如果我们要使 $s\oplus x$ 以及 $t \oplus x$ 的代价最小,那么我们将 $s$ 变成 $2^n-1$,再将 $2^n-1$ 变成 $t$ 所需要的代价一定严格不大于其它 $x$ 所花费的代价。::::info[code]{open}```cpp12 行未改动4 行未改动56789101112131415161712 行未改动4 行未改动### 题意题目描述清晰,不多讲述。### 结论$\forall s=t$,都有 $ans=0$。$\forall s,t \in [0,2^n)$ 且 $s \ne t$,都有 $ans=(s\oplus(2^n-1))+(t\oplus(2^n-1))$,其中 $ans$ 为最终的代价。### 证明若 $s = t$,那么答案为 $0$。若 $s\ne t$,如果我们要使 $s\oplus x$ 以及 $t \oplus x$ 的代价最小,那么我们将 $s$ 变成 $2^n-1$,再将 $2^n-1$ 变成 $t$ 所需要的代价一定严格不大于其它 $x$ 所花费的代价。::::info[code]{open}```cpp12 行未改动