CPP || USING MIN HEAP || MAP
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```\n#define ll long long\nclass Solution {\npublic:\n    vector<long long> unmarkedSumArray(vector<int>& v, vector<vector<int>>& q) {\n        int n=v.size();\n        vector<long long> ans;\n        ll sum=0;\n        priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>> p;\n        for(int i=0;i<n;i++)\n        {\n            sum+=v[i];\n            p.push({v[i],i});\n        }\n        map<int,int> m;\n        for(auto &it:q)\n        {\n            int index=it[0];\n            int k=it[1];\n            if(m[index]==0){m[index]=1;sum-=v[index];}\n\n            while(k>0)\n            {   \n                if(p.empty()){break;}\n                int ind=p.top().second;\n                int value=p.top().first;\n                p.pop();\n\n                if(m[ind]==1){continue;}\n                m[ind]=1;\n                sum-=value;\n                k--;\n            }\n            ans.push_back(sum);\n        }\n\n        return ans;\n    }\n};\n```
['C++']