Getting time limit exceeded for TSORT (turbo sort)?

i’m getting time limit exceeded even though i have used quicksort algorithm which uses O(nlogn) time…(the same time required by the sort() function given in algorithm library)…as required by the question!!
can anyone tell me what’s wrong with my solution?
here it is:
http://www.codechef.com/viewsolution/4803443

Hi! Try using faster i/p o/p methods either go for simple scanf and printf or you can go to the very depth and learn about getchar_unlocked and how using that and a char buffer you can get an ac for the question. The cin,cout are too slow when there is a large set of i/p o/p.

//