#P3615. Nim 积(Nim Product over $ \mathbb{F}_{2^{64}} $)
Nim 积(Nim Product over $ \mathbb{F}_{2^{64}} $)

Nim 积(Nim Product over )
问题描述
给定 组测试数据。对每组,输入两个非负整数 和 ,计算它们的 Nim 积 ,其中运算在域 上定义。
Nim 和()与 Nim 积()递归定义如下:
- $a \oplus b = \operatorname{mex}\big( \{a' \oplus b \mid a' < a\} \cup \{a \oplus b' \mid b' < b\} \big)$
- $a \otimes b = \operatorname{mex}\big( \{ (a' \otimes b) \oplus (a \otimes b') \oplus (a' \otimes b') \mid a' < a,\ b' < b \} \big)$
注:此处“”为题目标注,但实际 Nim 积是定义在非负整数上的二元运算,满足 当 ;本题约束保证 ,故结果仍在 64 位无符号整数范围内。
约束条件
输入格式
:
输出格式
:
11
5 0
5 1
5 2
5 3
5 4
5 5
5 6
5 7
5 8
3141 5926
18446744073709551615 18446744073709551615
0
5
10
15
2
7
8
13
3
14994
11290409524105353207