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!!!
Use fast I/O formats .You can use either scanf,printf or add this into your code (ios_base::sync_with_stdio(false);cin.tie(0);) .It passes like this