=====================================================================
What are the differences between this two sort function in Mo's algo?
First: if(q1.l/sq != q2.l/sq) { return q1.l < q2.l; } if((q1.l sq) & 1) { return q1.r < q2.r; } return q1.r > q2.r;
Second
bool comp(stt q1, stt q2) { if (q1.l / sq != q2.l / sq) return q1.l< q2.l; return (q1.r < q2.r)^(q1.l/sq%2); }
The first approach gives the wrong answer on test 67 but the second approach give AC :o Thanks in advance. v:)