C++ Solution [Fenwick Tree]
\n# Code\n\nclass FT{\npublic:\n    int n;\n    vector<int> bit;\n    FT(int _n){\n        this->n=_n;\n        bit.resize(n+1,0);\n    }\n\n    void add(int id
\n# Code\n```\nclass FT{\npublic:\n    int n;\n    vector<int> bit;\n    FT(int _n){\n        this->n=_n;\n        bit.resize(n+1,0);\n    }\n\n    void add(int id,int val){\n        while(id <= n){\n            bit[id]=max(bit[id],val);\n            id += (id & -id);\n        }\n    }\n\n    int query(int id){\n        int maxVal=0;\n        while(id > 0){\n            maxVal=max(maxVal,bit[id]);\n            id -= (id & -id);\n        }\n\n        return maxVal;\n    }\n};\n\nclass Solution {\npublic:\n    vector<bool> getResults(vector<vector<int>>& q) {\n        set<int> obs;\n        int n= min(5 * 10000 , 3 * (int)q.size()) + 1;\n        obs.insert(0);\n        obs.insert(n);\n        FT ft(n);\n\n        for(auto i:q){\n            if(i[0]==1){\n                obs.insert(i[1]);\n            }\n        }\n\n        for(auto it = obs.begin(); it != obs.end(); ++it){\n            if(it == obs.begin()){\n                continue;\n            }\n\n            auto pr=prev(it);\n            int id= *it, gapSize = (*it) - (*pr);\n            ft.add(id,gapSize);\n        }\n\n        vector<bool> ans;\n\n        for(int i=q.size()-1;i>=0;i--){\n            int type=q[i][0];\n            if(type==1){\n                int x=q[i][1];\n                auto it=obs.find(x);\n                auto pr=prev(it);\n                auto nxt=next(it);\n                obs.erase(it);\n                ft.add(*nxt, (*nxt) - (*pr));\n            }else{\n                int x=q[i][1],sz=q[i][2];\n                auto nxt=obs.upper_bound(x);\n                auto pr = prev(nxt);\n                int maxSize = max(ft.query(*pr),x-(*pr));\n                ans.push_back(maxSize>=sz);\n            }\n        }\n\n        reverse(ans.begin(),ans.end());\n        return ans;\n    }\n};\n```
['C++']