how to reduce compilation time in C ??

algorithm
c
c-plus-plus
compilation
optimize
reduce
time
tle

#1

I am getting TLE in my program … using for loops 2 times & it is showing TLE…how to optimize my algorithm?? plz help


#2

Optimization will depend on type and category of problem. for example if problem is sorting then it can be optimized from O(n^2) to O(n) but not below that. Share your problem and solution,then only any one can help.

Vaguely I can just suggest, try to do a thing in linear time i.e O(n) time rather than O(n^2) if it is giving TLE.


#3

if you use c++, then prefer scanf and printf over cin and cout, will compile quicker. i dont know any other trick yet.


#4

Actually the problem is from live contest and that’s why I won’t be able to discuss it here…but thanks for the advice


#5

yup. already using scanf & printf


#6

are u sure u want to reduce the compilation time…:stuck_out_tongue: