luogu#P10558. [ICPC2024 Xi'an I] XOR Game

[ICPC2024 Xi'an I] XOR Game

题目背景

statement updated:

zz is the number of numbers whose values are 00.

题目描述

Alice and Bob are playing a game against each other.

In front of them are a multiset {ai}\{a_i\} of non-negative integers and a single integer xx. Each number in aa is 00 or 2i(0i<k)2^i(0\le i<k) before the game.

This game will be a turn-based game, and Alice will go first. In one person's turn, he or she will choose an integer from aa. Let this number be pp. Then this person will choose whether or not to make xxpx\gets x\oplus p, then remove pp from aa. Here, operation \oplus means bitwise xor.

Alice wants to make xx as big as possible, and Bob wants to make xx as small as possible.

You are a bystander who wants to know the final value of xx. However, the size of aa is a huge number. Formally, there are bib_i numbers whose values are 2i2^i in aa for all 0i<k0\le i<k, and zz numbers whose values are 00. But you still want to challenge this impossible problem.

If Alice and Bob are smart enough, please output the final value of xx.

输入格式

The first line contains two integers k,z(1k105,0z109)k,z(1\le k\le10^5,0\le z\le 10^9).

The next line contains kk integers, the ii -th integer is bi1(0bi1109)b_{i-1}(0\le b_{i-1}\le10^9).

输出格式

Output the answer in binary format. Note that you should output exactly kk digit from high to low even though this number has leading 00s.

1 0
3
1
2 0
2 1
11
2 0
2 2
00