百度之星 2019 预赛三 A 最短路 1

时间:2019-08-25 18:18:55   收藏:0   阅读:69

题目链接

分析

异或运算满足「三角不等式」。
$\forall a, b, c \in \mathbb{Z}_{\ge 0}$,有 $a \xor b \le (a \xor c) + (c \xor b)$ 。
证明:容易证明:$\forall a, b \in \mathbb{Z}_{\ge 0}$,有 $a \xor b \le a + b$,因此 $a \xor b = (a \xor c) \xor (c \xor b) \le (a \xor c) + (c \xor b)$ 。

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!