#abc213a. A - Bitwise Exclusive Or
A - Bitwise Exclusive Or
Score : points
问题陈述
给定两个在 到 (包含)之间的整数 和 。求一个非负整数 ,使得 。
可以证明这样的 存在且唯一,并且它也会在 到 (包含)之间。
什么是按位异或?
整数 和 的按位异或(),记作 ,定义如下:
- 当以二进制形式表示 时,第 位()上的数字是:如果 和 中恰好有一个为 ,则该位为 ;否则为 。
例如,我们有 (以二进制表示:)。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given integers and between and (inclusive). Find a non-negative integer such that .
It can be proved that there uniquely exists such , and it will be between and (inclusive).
What is bitwise ?
The bitwise of integers and , , is defined as follows:
- When is written in base two, the digit in the 's place () is if exactly one of and is , and otherwise.
For example, we have (in base two: ).
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
3 6
Sample Output 1
5
When written in binary, will be , and will be . Thus, their will be in binary, or in decimal.
In short, , so the answer is .
Sample Input 2
10 12
Sample Output 2
6
update @ 2024/3/10 09:29:04