gahui and sousenkyo 6
면접 대비시간 제한1.5초메모리 제한512 MB
n과 x가 주어질 때, 서로 다른 n개의 양의 정수이면서 비트 XOR 값이 x인 수열을 출력한다.
문제
Gahui is watching the annual character election. After the election, The top 16 characters receive enormous benefits for one year. For that reason, fans vote passionately to get their favorite characters into the top 16. Remarkably, at least one Cinderella appears in every election, achieving an outstanding outcome.
Gahui missed the broadcast of the fascinating character election. On the Internet, there was only the following information:
- The number of characters participating in the election is .
- No two characters have the same number of votes, and each character has received at least one vote.
- When the bitwise-xor operation is applied to the votes of all characters, the result is .
- The number of votes for every character is less than .
Find character election results.
입력
and are given, separated by spaces.
출력
Print in the first line. is the number of characters participating in the election.
In the following lines, print the number of votes obtained by rank.
If there are multiple solutions, you may output any of them.