royappa's blog

By royappa, history, 9 years ago, In English

Hi, I'm working on http://mirror.codeforces.com/contest/580/problem/B and getting WA on test 7.
This is my code: http://ideone.com/IlboLx
I read the tutorial and it made sense, I'm just using upper_bound() instead of my own binary search.
Any hint on the bug would be great. Thanks!

  • Vote: I like it
  • -3
  • Vote: I do not like it

»
9 years ago, # |
  Vote: I like it +2 Vote: I do not like it

Oops I just realized the answer could overflow int. That fixed it.