Блог пользователя prabhav3257

Автор prabhav3257, история, 3 года назад, По-английски

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

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
3 года назад, # |
Rev. 6   Проголосовать: нравится +3 Проголосовать: не нравится

Check if replacing the endl output stream manipulator with '\n' resolves the TLE issue. In general, the endl manipulator makes an implicit os.flush() function call after making a os.put('\n') function call to print '\n', which slows down the program run-time. You should use endl 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