easy to use u can do in minutes with high skills 500% beats
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nstruct Node{\n    int left;\n    int right;\n    int mid;\n    int om;\n};\n//om sonekar\nclass SegmentTree{\npublic:\n    vector<Node>tree;\n    SegmentTree(int n){ \n        tree.resize(4*n);\n        for(int i=0;i<4*n;i++){\n            tree[i].left=0;\n            tree[i].mid=0;\n            tree[i].right=0;\n        }\n        build(1,0,n-1);\n    } \n    Node merge(Node l,Node r){\n        Node merged;\n        if(l.mid==-2&&r.mid==-2){\n            merged.left = merged.right=l.left+r.right;\n            merged.mid=-2;\n            return merged;\n        }\n        if(l.mid!=-2&&r.mid!=-2){\n            merged.left =l.left;\n            merged.right=r.right;\n            merged.mid = max({l.right+r.left,l.mid,r.mid});\n            return merged;\n        }\n         if(l.mid!=-2&&r.mid==-2){\n            merged.left = l.left;\n            merged.right = l.right+r.right;\n            merged.mid = max({l.mid,l.left,merged.right}); \n            return merged;\n        }\n        if(l.mid==-2&&r.mid!=-2){\n            merged.right = r.right;\n            merged.left = l.right+r.left;\n            merged.mid = max({r.mid,r.right,merged.left}); \n            return merged;\n        }\n        return merged;\n    }\n    Node build(int node,int l,int r){\n        if(l==r){\n            tree[node].left = 1;\n            tree[node].mid = -2;\n            tree[node].right = 1;\n            return tree[node];\n        } \n        int mid = l+(r-l)/2;\n        Node leftNode = build(2*node,l,mid);\n        Node rightNode = build(2*node+1,mid+1,r);\n        return tree[node]=merge(leftNode,rightNode);\n    }\n    Node update(int node,int l,int r,int target){\n        if(l==target&&r==target){\n            tree[node].left = 1;\n            tree[node].mid = -1;\n            tree[node].right = 1;\n            return tree[node];\n        }\n        if(r<target||l>target){\n            return tree[node];\n        }\n        int mid = l+(r-l)/2;\n        Node leftNode = update(2*node,l,mid,target);\n        Node rightNode = update(2*node+1,mid+1,r,target);\n        return tree[node]=merge(leftNode,rightNode);\n    }\n    Node query(int node,int l,int r,int ql,int qr){\n        if(ql==l&&qr==r){ \n            return tree[node];\n        }\n        if(ql>r||qr<l){\n            Node f;\n            f.left=0;\n            f.right=0;\n            f.mid=-2;\n            return f;\n        }\n        int mid = l+(r-l)/2;\n        Node leftNode = query(2*node,l,mid,ql,min(mid,qr));\n        Node rightNode = query(2*node+1,mid+1,r,max(ql,mid+1),qr);\n        return merge(leftNode,rightNode);\n    }\n};\nclass Solution {\npublic:\n    vector<bool> getResults(vector<vector<int>>& q) {\n        int n = min((int)60000,(int)(4*q.size()));\n        SegmentTree* st = new SegmentTree(n);\n        vector<bool>ans;\n        for(auto&it:q){\n            if(it[0]==1){\n                st->update(1,0,n-1,it[1]);\n            }else{\n                Node nn = st->query(1,0,n-1,0,it[1]);  \n                int limit = max({nn.left,nn.mid,nn.right})-1;\n                ans.push_back(limit>=it[2]);\n            }\n        }  \n        return ans;\n    }\n};\n```
['C++']