QOJ.ac

QOJ

حد الوقت: 1.0 s حد الذاكرة: 256 MB مجموع النقاط: 100 قابلة للهجوم ✓

#12404. 异或变换

الإحصائيات

MianKing 有一个整数 $X$,他想要通过一些操作将 $X$ 转换为 $Y$ ($Y < X$)。

在每次操作中,MianKing 可以选择一个整数 $0 \le A < X$,并令 $X = X \oplus A$。

注意,在进行一次操作后,$A$ 的取值上限会因为 $X$ 的改变而改变。

现在你需要帮助 MianKing 找到一种方法,通过最多 5 次操作将 $X$ 转换为 $Y$。

输入

第一行包含两个整数 $X, Y$。

$1 \le Y < X \le 10^{18}$。

输出

第一行包含一个整数 $d$,表示你进行的操作次数。

接下来有 $d$ 个整数 $A_1 \dots A_d$,表示你在每次操作中选择的 $A$。

$0 \le d \le 5$。

样例

输入 1

5 3

输出 1

3
1 2 5

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.