sixth_mancity_fan's blog

By sixth_mancity_fan, history, 6 months ago, In English

I was doing the problem Bandit in a city. My submission used binary search to find the answer and check it. The problem arises for cases with answer 0 the code gave TLE on test 7. On using max() instead of + this code passed in 953 ms. I had to check for the corner case because the initial binary search code also gave TLE on test 7. I could not find anything to explain these. Is addition on long long integers slower than using max.

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it