I tried couple of times.Task# 8-15 passed for Subtask 2. Subtask 1 completely failed. I am still wondering what did i miss in my solution. Here is my solution http://www.codechef.com/viewsolution/5532642
@skysarthak Follow the algorithm in the second answer (with 4 upvotes) After you transform the array to the echelon form donāt worry about which bit is set etc, just select the value if the XOR increases, like so:
max = k
for value in array:
if max ^ value > max: max = max ^ value
Also, what is then wrong with the following approach http://www.codechef.com/viewsolution/5527772 , itās doing the same thing by just dividing the input set in two different sets as explained in my answer below.
If you find clear proof of analogy of gauss elimination method=>Then kindly comment the link (other than mathematics stack exchange=>maximization of xor operator!!).
At last but not the least=>actually (2 upvotes>1upvote)!!!
@rudra_sarraf I have already got AC on this logic. First open the code or link I have mentioned in my comment carefully and then say!! I think discussion forums are for help people want to do themselves and no one is forcing you to see someoneās problems or errors. So better not use any more harsh words here!!! And also, I was just joking for that upvote thing.
can any one explain why gaussian method work.?? i mean after take echleon form of the matrix what happend that it is giving me sum of each subset from the given setā¦
First do the gaussian elimination, now traverse through each row. having the value of k, do k xor the first row and if the result is bigger than k, assign the value of the result to k, otherwise donot change k.
Can anyone please explain how Gaussian Elimination is applied on this problem. I saw the stack exchange link but couldnāt make out anything from that.