Gap
Time limit2sMemory limit512 MB
Given an increasing sequence of N non-negative integers accessed only through a query function, return the largest gap between consecutive elements.
- Level
Medium6 of 10
- Topics
- Binary search, Implementation, Divide and conquer, Math
- Solved
- No attempts yet
Problem
There are non-negative integers satisfying . Jeehak wants to know the largest possible value of over . The input integers are not given directly to Jeehak's program; they are accessible through a special function. See the Implementation section for your chosen programming language for details.
Implement a function that returns the largest possible value of over .
Constraints
In all subtasks, .