Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///http://codeforces.com/blog/entry/43440
- /// MAXIMUM
- int lo = -1, hi = n;
- while (hi - lo > 1){
- int mid = (hi + lo)>>1;
- if (f(mid) > f(mid + 1))
- hi = mid;
- else
- lo = mid;
- }
- //lo + 1 is the answer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement