Easy Sagment Tree Solution
\n\n# Code\n\nclass Solution {\n\nint st[600005], lazy[600005];\nint arr[150005];\n\nvoid build(int si, int ss, int se){\n    if(ss == se){\n        st[si] = ar
\n\n# Code\n```\nclass Solution {\n\nint st[600005], lazy[600005];\nint arr[150005];\n\nvoid build(int si, int ss, int se){\n    if(ss == se){\n        st[si] = arr[ss];\n        return;\n    }\n\n    int mid = (ss+se)/2;\n\n    build(2*si+1, ss, mid);\n    build(2*si+2, mid+1, se);\n\n    st[si] = max(st[2*si+1], st[2*si+2]);\n}\n\nint query(int si, int ss, int se, int qs, int qe){\n    if(lazy[si] != 0){\n        int cnt = lazy[si];\n        lazy[si] = 0;\n        st[si] += cnt;\n\n        if(ss != se){\n            lazy[2*si+1] += cnt;\n            lazy[2*si+2] += cnt;\n        }\n    }\n\n    if(qs > se || qe < ss) return 0;\n    if(qs <= ss && qe >= se) return st[si];\n\n    int mid = (ss+se)/2;\n    int l = query(si*2+1, ss, mid, qs, qe);\n    int r = query(si*2+2, mid+1, se, qs, qe);\n\n    return max(l, r);\n}\n\nvoid update(int si, int ss, int se, int qs, int qe, int val){\n    if(lazy[si] != 0){\n        int cnt = lazy[si];\n        lazy[si] = 0;\n        st[si] += cnt;\n\n        if(ss != se){\n            lazy[2*si+1] += cnt;\n            lazy[2*si+2] += cnt;\n        }\n    }\n\n    if(qs > se || qe < ss) return;\n    if(qs <= ss && qe >= se){\n        st[si] += val;\n\n        if(ss != se){\n            lazy[2*si+1] += val;\n            lazy[2*si+2] += val;\n        }\n        return;\n    }\n\n    int mid = (ss+se)/2;\n    update(si*2+1, ss, mid, qs, qe, val);\n    update(si*2+2, mid+1, se, qs, qe, val);\n\n    st[si] = max(st[2*si+1], st[2*si+2]);\n}\n\npublic:\n    vector<bool> getResults(vector<vector<int>>& queries) {\n        vector<bool> ans;\n        set<int> st;\n        st.insert(0);\n        st.insert(150005);\n        for(int i = 0; i < 150005; i++){\n            arr[i] = i;\n        }\n        build(0, 0, 150004);\n        for(auto it: queries){\n            if(it[0] == 1){\n                auto ind = st.lower_bound(it[1]);\n                auto ind2 = ind;\n                ind2--;\n                int y = *ind2;\n                int z = *ind;\n                int val = y-it[1];\n                update(0, 0, 150004, it[1]+1, z, val);\n                st.insert(it[1]);\n            }else{\n                int x = it[1];\n                int siz = it[2];\n                int maxi = query(0, 0, 150004, 0, x);\n                if(maxi >= siz) ans.push_back(true);\n                else ans.push_back(false);\n            }\n        }\n\n        return ans;\n    }\n};\n```
['C++']