An interesting approach, segment tree and merging nodes (maintaining left/right and maxim)
Intuition\n\n# Approach\n\n# Complexity\n- Time complexity:\nN * log(n)\n\n- Space complexity:\n5e4\n\n# Code\n\nclass Segment {\n    public:\n    vector<int> l
# Intuition\n\n# Approach\n\n# Complexity\n- Time complexity:\nN * log(n)\n\n- Space complexity:\n5e4\n\n# Code\n```\nclass Segment {\n    public:\n    vector<int> left;\n    vector<int> right;\n    vector<int> mid;\n    vector<int> sz;\n    int n;\n    \n    Segment(int _n) {\n        n = _n;\n        left.resize(4*n);\n        right.resize(4*n);\n        mid.resize(4*n);\n        sz.resize(4*n);\n        init(0, 0, n-1);\n    }\n    \n    void init(int idx, int l2, int r2) {\n        if (l2 == r2 && l2 == 0) return;\n        if (l2 == r2) {\n            left[idx] = 1;\n            right[idx] = 1;\n            mid[idx] = 1;\n            sz[idx] = 1;\n            return;\n        }\n        \n        int m = (l2+r2)/2;\n        init(idx*2+1, l2, m);\n        init(idx*2+2, m+1, r2);\n        sz[idx] = sz[idx*2 + 1] + sz[idx*2 + 2];\n        mid[idx] = sz[idx];\n        left[idx] = sz[idx];\n        right[idx] = sz[idx];\n    }\n    \n    void update(int idx, int index, int l2, int r2) {\n        // cout << idx << endl;\n        // cout << index << " " << l2 << " " << r2 << endl;\n        if (l2 == r2) {\n            left[idx] = 0;\n            right[idx] = 0;\n            mid[idx] = 0;\n            return;\n        }\n\n        int m = (l2+r2)/2;\n        if (index <= m)\n            update(idx*2+1, index, l2, m);\n        if (index >= m+1)\n            update(idx*2+2, index, m+1, r2);\n        \n        int rightnext = right[idx*2+2];\n        if (rightnext == sz[idx*2+2]) {\n            rightnext += right[idx*2+1];\n        }\n        \n        int leftnext = left[idx*2+1];\n        if (leftnext == sz[idx*2+1]) {\n            leftnext += left[idx*2+2];\n        }\n        // cout << leftnext << " " << rightnext << endl;\n        \n        int maxim = max(mid[idx*2 + 2], mid[idx*2 + 1]);\n        maxim = max(maxim, left[idx*2+2] + right[idx*2+1]);\n        mid[idx] = maxim;\n        left[idx] = leftnext;\n        right[idx] = rightnext;\n    }\n    \n\n    \n    array<int,4> request(int idx, int l1, int r1, int l2, int r2) {\n        if (r1 < l2 || l1 > r2)\n            return {0,0,0,0};\n        if (l1 <= l2 && r1 >= r2) {\n            return {left[idx], right[idx], mid[idx], sz[idx]};\n        }\n        \n        int m = (l2 + r2)/2;\n        array<int,4> releft = {0,0,0,0};\n        array<int,4> reright = {0,0,0,0};\n        if (l1 <= m)\n            releft = request(idx*2 + 1, l1,r1,l2,m);\n        if (r1 >= m+1)\n            reright = request(idx*2 + 2, l1,r1,m+1,r2);\n        \n        int rightnext = reright[1];\n        if (rightnext == reright[3]) {\n            rightnext += releft[1];\n        }\n        \n        int leftnext = releft[0];\n        if (leftnext == releft[3]) {\n            leftnext += reright[0];\n        }\n        \n        int maxim = max(reright[2], releft[2]);\n        maxim = max(maxim, reright[0] + releft[1]);\n        int size = releft[3] + reright[3];\n        return {leftnext, rightnext, maxim, size};   \n    }  \n};\n\nclass Solution {\npublic:\n    vector<bool> getResults(vector<vector<int>>& queries) {\n        int n = 50001;\n        Segment seg(n);\n        \n        vector<bool> re;\n        for (auto& each: queries) {\n            int t = each[0];\n            if (t == 1) {\n                int x = each[1];\n                seg.update(0, x, 0, n-1);\n            } else {\n                int x = each[1];\n                int sz = each[2];\n                array<int,4> it = seg.request(0, 0, x-1, 0, n-1);\n                int gap = it[2];\n                if (x < sz) { re.push_back(false); continue; }\n                if (gap+1 >= sz) {\n                    re.push_back(true);\n                } else\n                    re.push_back(false);\n            }\n        }\n        \n        \n        return re;\n        \n        \n    }\n};\n```
['C++']