From a96b65cbfad7f62f3db6b2eab105e4e25c0414c5 Mon Sep 17 00:00:00 2001 From: Jack Sangdahl Date: Fri, 27 Jun 2025 12:23:02 -0600 Subject: chore: remove old cpp and rust solutions --- other/max_performance_team.cpp | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 other/max_performance_team.cpp (limited to 'other/max_performance_team.cpp') diff --git a/other/max_performance_team.cpp b/other/max_performance_team.cpp deleted file mode 100644 index a7e4be8..0000000 --- a/other/max_performance_team.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "leetcode.h" - -class Solution { -public: - const int mod = 1e9 + 7; - int maxPerformance(int n, vector &speed, vector &efficiency, - int k) { - priority_queue, greater> pqvg; - vector> vp; - for (int i = 0; i < n; i++) - vp.push_back({efficiency[i], speed[i]}); - sort(vp.rbegin(), vp.rend()); - long totSpeed = 0, ans = 0; - for (int i = 0; i < n; i++) { - int currEff = vp[i].first, currSpeed = vp[i].second; - if (pqvg.size() == k) { - totSpeed -= pqvg.top(); - pqvg.pop(); - } - pqvg.push(currSpeed); - totSpeed += currSpeed; - ans = max(ans, totSpeed * currEff); - } - return ans % mod; - } -}; - -int main() { - Solution obj; - int n = 6, k = 2; - vector speed = {2, 10, 3, 1, 5, 8}, efficiency = {5, 4, 3, 9, 7, 2}; - cout << obj.maxPerformance(n, speed, efficiency, k); -} -- cgit v1.2.3