Hello , i kept getting WA on task-4 only, and I couldn’t figure out what is wrong…
but looking at my code deeply, i “thought” that the second part of the condition on line 103
bIt != w.begin() is redundant, because if only a bigger element exists, surely it won’t be the first one after sorting (since it is guaranteed that there is at least one valid wormhole pair for some contest) , so removed that part with no clue that it could lead to AC, and sure enough i got AC…
is at line 103
Can you help me understand why? or give me input like task-4?