using namespace std;
I can’t understand why it is giving time limit exceed and which sorting algorithm does sort(s,s+n) uses and what’s is complexity ?? plz also suggest me some other algo to reduce complexity of my program!!
It’s getting TLE due to slower I/O. Using
printf this solution will get AC. Accepted code
This problem can also be solved using counting sort in O(n) time.
scanf printf faster than cin cout
STL Sort algorithm
Post a link to your code instead of pasting the entire code here.
Thanks finally get my code accepted!!
Why i getting code accepted in this case
and not in that case due to time limit exceeded although these are same
Plz help me!!
@chaman_amit If you got the answer for your question,then you should mark it as the correct answer,so that it won’t appear in unanswered questions.
I won’t find any option to mark as correct answer , plz tell me so i ll do that!!
Can anyone please explain me why it is giving TIME LIMIT EXCEEDED ?