#d2732. 简单的异或问题

简单的异或问题

Simple XOR Problem

Problem Description

Consider the set of integers {0,1,2,…,2m−1}\lbrace 0, 1, 2, \ldots, 2^m - 1 \rbrace. Choose kk numbers from it so that their XOR sum equals nn. Output the largest possible kk.

Input Format

Two numbers nn and mm, where 0≤n≤2m−10 \leq n \leq 2^m - 1 and 1≤m≤601 \leq m \leq 60.

Output Format

Output the largest possible kk.

Sample Input

2 2

Sample Output

3

Sample Explanation

For the sample, we can choose {0,1,3}\lbrace 0, 1, 3 \rbrace, whose XOR sum is 22.