I am only getting AC in Subtask 2 Task #1 and rest of all WA.
I have tried many custom test cases which worked correctly.
Can Anybody Point out where i am going wrong?
Thanks In Advance!
There seems to be a problem with your customsort function. Since you are accessing the elements from the rear after sorting V, I believe you should sort the bits in the opposite order to ensure minimum X.
Yes i also realized that my algorithm seems correct but main problem is with customsort.
Before seeing your solution, can you guide how can i change my customsort function
Since you are accessing the elements in reverse order, x.second should be sorted in decreasing order rather than increasing order otherwise, the largest value of x.second will be accessed first.