vector and pair using this solution
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```\nclass Solution {\npublic:\n    vector<long long> unmarkedSumArray(vector<int>& nums, vector<vector<int>>& queries) {\n       vector<pair<int,int>>p1;\n       for(int i=0;i<nums.size();i++){\n           p1.push_back({nums[i],i});\n       }\n        vector<int>pos;\n        vector<int>vis(nums.size(),0);\n        sort(p1.begin(),p1.end());\n        for(auto i:p1){\n            pos.push_back(i.second);\n        }\n        long long totsum = 0;\n        for(int i=0;i<nums.size();i++){\n            totsum = totsum+nums[i];\n        }\n        vector<long long>ans(queries.size(),0);\n        int k=0;\n        for(int i=0;i<queries.size();i++){\n            int x = queries[i][0];\n            int y = queries[i][1];\n            if(vis[x] == 0){\n                vis[x] = 1;\n                totsum = totsum-nums[x];\n            }\n            if(totsum == 0){\n                break;\n            }\n            for(int i=0;i<nums.size();i++){\n                if(vis[pos[i]] == 0 && y!=0){\n                    vis[pos[i]] = 1;\n                    y--;\n                    totsum = totsum-nums[pos[i]];\n                    if(y == 0){\n                        break;\n                    }\n                }\n            }\n            ans[k] = totsum;\n            k++;\n        }\n        \n        return ans;\n    }\n};\n```
['Hash Table', 'C++']