832. Mex Sequence

In this problem is used to represent the bitwise exclusive or of two numbers. Starting with blank paper repeatedly do the following:

  1. Write down the smallest positive integer which is currently not on the paper;
  2. Find the smallest positive integer such that neither nor is currently on the paper. Then write down both and .

After the first round will be written on the paper. In the second round and because , and are all already written must be .

After rounds there will be numbers on the paper. Their sum is denoted by .
For example, and .

Find . Give your answer modulo .

832. mex1 序列

本题用 表示两个数的按位异或运算。

我们在一张白纸上,进行如下操作:

  1. 写下目前不在纸上的最小正整数。
  2. 找到最小的正整数 ,使其满足 都不在纸上,随后写下

第一轮后纸上有 三个数。第二轮中 ,而且因为 都在纸上,所以

轮后,纸上会有 个数,记它们的和为 。已知:

之值。


这个链接 回到源站。

这个链接 回到详细版题目目录。


1 mex 为 minimal excluded 的缩写,在此过程中的第二步被体现。信息学竞赛中一般不翻译 mex,这里也不翻译。另外,一般的 mex 运算一般是不在某个数集中最小的自然数,而非正整数。