I was solving a problem on codechef called Doof fires Brackets (Problem Code: CLBRKT) https://www.codechef.com/problems/CLBRKT
https://www.codechef.com/viewsolution/49112518
and this is my solution after numerous attempts i am still getting a TLE please help me solve this problem
Check if replacing the
endl
output stream manipulator with'\n'
resolves the TLE issue. In general, theendl
manipulator makes an implicitos.flush()
function call after making aos.put('\n')
function call to print'\n'
, which slows down the program run-time. You should useendl
only in interactive problems, where you would like to make sure that no characters are still pending in the output stream buffer before reading the next data item from the input stream.std::endl
ya that solved the issue thanks alot