0. The events in requests happen one after another:
- [1, x]: a post is put up at point x. There is guaranteed to be no post there yet;
- [2, x, size]: report whether a car of length size could be parked entirely within the segment [0, x] with no post strictly inside the car. The car's ends may touch a post. The car is not actually parked, so the checks are independent.
Return a list of True/False answers to all type-2 requests, in the order they come.requests=[[1, 4], [2, 6, 4], [2, 6, 5], [1, 1], [2, 6, 4]] → [True, False, False]
With a post at 4, the segment [0, 6] has free stretches of length 4 and 2: a car of length 4 fits, a car of length 5 does not. After a post at 1 the stretches are 1, 3 and 2, so length 4 no longer fits.
requests=[[2, 3, 3], [1, 2], [2, 3, 3], [2, 9, 3]] → [True, False, True]
At first there are no posts and a car of length 3 fills all of [0, 3]. A post at 2 breaks that. On [0, 9] the stretch from 2 to 9 is free, so there is room.
len(requests) ≤ 1.5·10⁵[1, x], a type-2 request is [2, x, size]x, size ≤ min(5·10⁴, 3·len(requests))requests=[[1, 4], [2, 6, 4], [2, 6, 5], [1, 1], [2, 6, 4]]
[True, False, False]
Run checks the first 3 tests in your browser. Submit checks all 124 tests on the server, hidden ones included.