what are the optimisation approaches which one can use to get rid of ‘time limit exceeded’ problem during submitting code?
To get rid of TLE, you need to understand the constraints of that particular problem, then only start with coding.
Costraints tell us about codechef compiler capacity…i think we do not need to discus about constraints
generally on CodeChef, when you are getting TLE, it means that your algorithm is not correct and you need to work in that direction.
But ya few times, optimization techniques are required.
Just for example, if you use c++, then prefer scanf and printf over cin and cout, will be quicker.
And many more techniques like this…
Rest as no ongoing contest is going on, you can share the code in which you found such problems. I would be glad to help
YOU CAN LEARN ALOT FROM HERE : https://www.coursera.org/course/optimization
http://www.codechef.com/problems/COMPILER/ check this problem and tell me what’s wrong with my cod please
thank you kunal but without constraints this code is working
I am dealing with the same problem.
sorry processor capacity
actually u r wrong…we indeed need to understand the constraints!!!
this code showing time exceed problem according you…it’s follow constraints or pressure
tell me mistr kunal
u dont get it…constraints help u manipulate ur algorithm!!!
i’ll give u a sum…see how the constraints help…http://www.codechef.com/AUG13/problems/CHMOD/
if u want i can give u many more such examples…one more…which is one of the easiest sums…where constraints help u reduce time is http://www.codechef.com/problems/TSORT …just try it!!!
this is ur corrected code…http://www.codechef.com/viewsolution/3904444 can u guess what was eating up the time???
you are really helpful thanks for catching error in my script
that is not what @vikascingh and i are trying to convey…!!!