• 2024-06-22LeetCode 2542. 最大子序列的分数(贪心、小顶堆)
    2542.最大子序列的分数思路:先对nums2按降序排列,然后遍历nums2的最小值,同时在区间[0,i]中选中k个最大的nums1即可。然后找出最大的ansclassSolution{public:typedefpair<int,int>PII;longlongmaxScore(vector<int>&nums1,vector<int>&nums2,intk)