C++ | Maxheap | Priority Queue
\nclass Solution {\npublic:\n    int fillCups(vector<int>& amount) {\n        priority_queue<int>pq;\n        for(auto i:amount)if(i>0)pq.push(i);\n        int 
```\nclass Solution {\npublic:\n    int fillCups(vector<int>& amount) {\n        priority_queue<int>pq;\n        for(auto i:amount)if(i>0)pq.push(i);\n        int ans=0;\n        while(pq.size()>=2)\n        {\n            int one =pq.top();\n            pq.pop();\n            int two=pq.top();pq.pop();\n            if(one>1)pq.push(one-1);\n            if(two>1)pq.push(two-1);\n            ans++;\n        }\n        if(!pq.empty())\n        ans+=pq.top();\n        return ans;\n    }\n};\n```
['C', 'Heap (Priority Queue)', 'C++']