Bit Masking : Spoj:XMAX

How i can use bitmasking technique to solve spoj XMAX problem, I am a beginner its hard to understand bit masking… Can anyone help me to understand bit masking well and how i can implement that in XMAX problem

1 Like

That problem is extremely similar to current contest problem XORSUB, so we should probably refrain from discussing a solution to that problem.

However we can discuss the bitmasking technique in general. Read about it here and ask about any specific doubts if they arise.

I’m just confused how to use this technique to get sub arrays. Thanks sir…:slight_smile: I will try to find out the possible solution thanks sir…:slight_smile:

glad to help :slight_smile:

I don’t think, you can solve XMAX using bitmasking, the constraints are too big for bitmasking to be useful.
Please see the following link for approach to solve the problem http://math.stackexchange.com/questions/48682/maximization-with-xor-operator