c++ PriorityQueue,Set
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<int> busiestServers(int k, vector<int>& arrival, vector<int>& load) {\n        unordered_map<int,int>count;\n        priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>>pq;\n        set<int>st;\n        for(int i=0;i<k;i++){\n           st.insert(i);\n        }\n        int maxi = 0;\n        for(int i=0;i<arrival.size();i++){\n            while(!pq.empty() && arrival[i]>=pq.top().first){\n                st.insert(pq.top().second);\n                pq.pop();\n            }\n            if(st.size()>0){\n                int index = (i%k);\n                auto it = st.lower_bound(index);\n                if(it==st.end()){\n                    count[*st.begin()]++;\n                    maxi = max(maxi,count[*st.begin()]);\n                    pq.push({arrival[i]+load[i],*st.begin()});\n                    st.erase(st.begin());\n                }else{\n                    int index2 = *it;\n                    count[index2]++;\n                    maxi = max(maxi,count[index2]);\n                    pq.push({arrival[i]+load[i],index2});\n                    st.erase(it);\n                }\n            }\n        }\n        vector<int>ans;\n        for(auto it:count){\n            if(it.second==maxi){\n                ans.push_back(it.first);\n            }\n        }\n        return ans;\n    }\n};\n```
['C++']