Please read the new rule regarding the restriction on the use of AI tools. ×

sixth_mancity_fan's blog

By sixth_mancity_fan, history, 3 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.

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

»
3 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

That's actually just luck. When you submit the same solution you can get a bit different time because of some server conditions.

I submitted your OK solution and got TL7

https://codeforces.me/contest/1436/submission/264584086