D. Ehab and the Expected XOR Problem
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Given two integers nn and xx, construct an array that satisfies the following conditions:
- for any element aiai in the array, 1≤ai<2n1≤ai<2n;
- there is no non-empty subsegment with bitwise XOR equal to 00 or xx,
- its length ll should be maximized.
A sequence bb is a subsegment of a sequence aa if bb can be obtained from aa by deletion of several (possibly, zero or all) elements from the beginning and several (possibly, zero or all) elements from the end.
Input
The only line contains two integers nn and xx (1≤n≤181≤n≤18, 1≤x<2181≤x<218).
Output
The first line should contain the length of the array ll.
<