How to avoid TLE for this problem?

Revision en3, by ryoko1, 2017-04-20 18:42:21

the problem tag is: 796B - Find The Bone Here is my sol: 26520634. Another query is that in the above submission when I change my array size from (n+1) to max the OJ gives me TLE on 5th test case. Why is it so? According to my knowledge array creation is a O(1) process and should not affect the time complexity of the program by any means. Your help will be appreciated!!!

Tags #c++, array limit

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English ryoko1 2017-04-20 18:42:21 5
en2 English ryoko1 2017-04-20 18:41:30 2 Tiny change: '[problem:769B]\nHere i' -> '[problem:796B]\nHere i'
en1 English ryoko1 2017-04-20 18:40:28 419 Initial revision (published)