Python | Segment Tree + Sorted List | O(nlogn)
Code\n\nfrom sortedcontainers import SortedList\nclass Solution:\n    def getResults(self, queries: List[List[int]]) -> List[bool]:\n        sl = SortedList([0]
# Code\n```\nfrom sortedcontainers import SortedList\nclass Solution:\n    def getResults(self, queries: List[List[int]]) -> List[bool]:\n        sl = SortedList([0])\n        N = 5*(10**4)\n        tree = [0]*(4*N)\n        def query(tree,v,tl,tr,l,r):\n            if r < tl or tr < l:\n                return 0\n            elif l<=tl and tr<=r:\n                return tree[v]\n            else:\n                m = (tl+tr)//2\n                return max(query(tree,2*v,tl,m,l,r), query(tree,2*v+1,m+1,tr,l,r))\n        def update(tree,v,tl,tr,idx,val):\n            if tl==idx==tr:\n                tree[v]=val\n                return val\n            mid = (tl+tr)//2    \n            if tl<=idx<=mid:\n                tree[v]=max(update(tree,2*v,tl,mid,idx,val),tree[2*v+1])\n            else:\n                tree[v]=max(tree[2*v],update(tree,2*v+1,mid+1,tr,idx,val))\n            return tree[v]        \n        res = []\n        for q in queries:\n            if q[0] == 1:\n                i = sl.bisect_left(q[1])\n                if i == len(sl):\n                    idx = sl[-1]\n                    update(tree, 1, 0, N-1, idx, q[1]-idx)\n                else:\n                    idx = sl[i-1]\n                    update(tree, 1, 0, N-1, idx, q[1]-idx)\n                    update(tree, 1, 0, N-1, q[1], sl[i]-q[1])\n                sl.add(q[1])\n            else:\n                _, x, sz = q\n                i = sl.bisect_left(x)\n                #print("sl, i", sl, i)\n                widest = x-sl[i-1]\n                if i == 1:\n                    left = 0\n                else:\n                    left = query(tree, 1, 0, N-1, 0, sl[i-1]-1)\n                res.append(max(widest, left)>=sz)\n        return res\n                \n                \n        \n```
['Python3']