Segment Tree Solution
Segment Tree implementation for this problem:(probably not worth it):\nnode of segment tree represents: {i, j, lo, ro, m}\nwhere node is for range [i , j + 1), 
Segment Tree implementation for this problem:(probably not worth it):\nnode of segment tree represents: {i, j, lo, ro, m}\nwhere node is for range [i , j + 1), and,\ni = start index of node(= start of range).\nj = end index of node(= end of range - 1).\nlo = leftmost obstacle in this range.\nro = right most obstacle in this range.\nm = max block size in this range.\n```\nclass Solution {\n    int find(vector<vector<int> >& segTree, int x, int y, int i){\n        int a = segTree[i][0];\n        int b = segTree[i][1];\n        if(x == a && y == b) return segTree[i][4];\n        if(x >= segTree[2*i + 2][0]){\n            return find(segTree, x, y, 2*i + 2);\n        }\n        else if(y <= segTree[2*i + 1][1]){\n            return find(segTree, x, y, 2*i + 1);\n        }\n        else {\n            int c = find(segTree, x, segTree[2*i + 1][1], 2*i + 1);\n            c = max(c, find(segTree, segTree[2*i + 2][0], y, 2*i + 2));\n            \n            int d = segTree[2*i + 1][3];\n            int e = segTree[2*i + 2][2];\n            if(d == - 1 && e == -1){\n                return y - x + 1;\n            }\n            else if(d == -1){\n                e = min(e, y + 1);\n                c = max(c, e - x);\n            }\n            else if(e == -1){\n                d = max(x, d);\n                c = max(c, y - d + 1);\n            }\n            else{\n                e = min(e, y + 1);\n                d = max(x, d);\n                c = max(c, e - d);\n            }\n            return c;\n        }\n    }\npublic:\n    vector<bool> getResults(vector<vector<int>>& queries) {\n        int n = queries[0][1];\n        for(vector<int> &x: queries) n = max(n, x[1] + 1);\n        int m = 1;\n        while(m < n) m <<= 1;\n        int s = m - 1;\n        int l = s + m;\n        vector<vector<int> > segTree(l, vector<int>(5, 0));\n        for(int i = 0; i < m; i++){\n            segTree[s + i] = {i, i, -1, -1, 1};\n        }\n        int a, b, c, d, e;\n        for(int i = s - 1; i >= 0; i--){\n            a = 2*i + 1;\n            b = 2*i + 2;\n            segTree[i] = {segTree[a][0], segTree[b][1], -1, -1, segTree[a][4] + segTree[b][4]};\n        }\n        vector<bool> ans;\n        for(vector<int> x: queries){\n            a = x[1];\n            if(x[0] == 1){\n                segTree[s + a][2] = a;\n                segTree[s + a][3] = a;\n                segTree[s + a][4] = 0;\n                c = (s + a - 1)/2;\n                while(c > 0){\n                    d = -1;\n                    e = -1;\n                    if(segTree[2*c + 1][2] != -1) d = segTree[2*c + 1][2];\n                    else d = segTree[2*c + 2][2];\n                    if(segTree[2*c + 2][3] != -1) e = segTree[2*c + 2][3];\n                    else e = segTree[2*c + 1][3];\n                    segTree[c][2] = d;\n                    segTree[c][3] = e;\n                    segTree[c][4] = max(segTree[2*c + 1][4], segTree[2*c + 2][4]);\n                    d = segTree[2*c + 1][3];\n                    e = segTree[2*c + 2][2];\n                    //both d and e can\'t be -1 during update\n                    if(d == -1){\n                        segTree[c][4] = e - segTree[2*c + 1][0];\n                    }\n                    else if(e == -1){\n                        segTree[c][4] = segTree[2*c + 2][1] - d + 1;\n                    }\n                    else{\n                        segTree[c][4] = max(segTree[c][4], e - d);\n                    }\n                    c = (c - 1)/2;\n                }\n                d = -1;\n                e = -1;\n                if(segTree[1][2] != -1) d = segTree[1][2];\n                else d = segTree[2][2];\n                if(segTree[2][3] != -1) e = segTree[2][3];\n                else e = segTree[1][3];\n                segTree[0][2] = d;\n                segTree[0][3] = e;\n                segTree[0][4] = max(segTree[1][4], segTree[2][4]);\n                d = segTree[1][3];\n                e = segTree[2][2];\n                //both d and e can\'t be -1 during update\n                if(d == -1){\n                    segTree[0][4] = e - segTree[1][0];\n                }\n                else if(e == -1){\n                    segTree[0][4] = segTree[2][1] - d + 1;\n                }\n                else{\n                    segTree[0][4] = max(segTree[0][4], e - d);\n                }\n            }\n            else{\n                b = find(segTree, 0 , a - 1, 0);\n                if(b >= x[2]) ans.push_back(true);\n                else ans.push_back(false);\n            }\n        }\n        return ans;\n    }\n};\n```
['Tree']