hey i'm getting tle (time limit exceeded) for the following code the problem is http://www.codechef.com/problems/TSORT/
im not getting the problem in it pls help........ Thanx.... asked 23 Jul '14, 14:53

actually this qus requires O(n) sorting algorithm, take a look at the constraints for N, you can use count sort :) answered 23 Jul '14, 17:23

The i/p o/p speed of python is not great combined that with you using the sort function with an average time complexity of nlogn. Maybe the nlogn implementation can work in c/c++ with faster i/p & o/p but not in this implementation of python at least. Try reading about counting sort. Hope that helps :) answered 23 Jul '14, 15:37
