I submitted a solution for XRQRS in C which showed TLE in last test case of first subtask:
http://www.codechef.com/viewsolution/5824459
and the same problem when submitted in C++ gave me AC:
http://www.codechef.com/viewsolution/5830056
Maybe it is because of the difference between the complexities of qsort and sort library functions in c and c++, but I am not sure. Can someone explain this?