← 返回 capitalone 的题目列表Obstacle Placement and Range Checking
类型:online_judge
On a number line, execute the following operations:
[1, x]: Place an obstacle at position x
[2, x, size]: Check if a structure of size centered at x can be built
Output '1' if possible, '0' if not.
Input: [ [1, 5], [2, 5, 3], [1, 7], [2, 5, 6] ] Output: [1, 0]
Obstacles and number line positions do not exceed 10^9.
Example
Input
[ [1, 5], [2, 5, 3], [1, 7], [2, 5, 6] ]