[C++] why using vector<int> in priority_queue got TLE?
I used vector in priority_queue then I got TLE. \nBut if I replace the vector with pair in priority_queue, it passes all test cases.\nJust wonder why it happens
I used vector<int> in priority_queue then I got TLE. \nBut if I replace the vector<int> with pair<int, int> in priority_queue, it passes all test cases.\nJust wonder why it happens?\n\nHere\'s my code:\n```\nclass Solution {\npublic:\n    static double cal(vector<int>& v) {\n        return (double) (v[1] - v[0]) / (double) (v[1] * (v[1] + 1));\n    }\n    \n    struct compare {\n        bool operator() (vector<int>& a, vector<int>& b) {\n            return cal(b) > cal(a);\n        }\n    };\n    \n    double maxAverageRatio(vector<vector<int>>& cs, int es) {\n        priority_queue<vector<int>, vector<vector<int>>, compare> q;\n        for (auto& c : cs) {\n            q.emplace(c);\n        }\n        \n        while (es > 0) {\n            auto maxn = q.top();\n            q.pop();\n            maxn[0]++;\n            maxn[1]++;\n            q.push(maxn);\n            es--;\n        }\n        double total = 0;\n        while (!q.empty()) {\n            auto& c = q.top();\n            total += (double)(c[0]) / (double)(c[1]);\n            q.pop();\n        }\n        return total / (double) cs.size();\n    }\n\n};\n```
[]