This commit is contained in:
2025-09-15 21:12:04 +08:00
commit 3f58f483ff
144 changed files with 5298 additions and 0 deletions

26
23/10/Q2530.h Normal file
View File

@@ -0,0 +1,26 @@
//
// Created by 李洋 on 2023/10/18.
//
#ifndef LEECODE_C_Q2530_H
#define LEECODE_C_Q2530_H
#include <vector>
#include <queue>
using namespace std;
long long maxKelements(vector<int> &nums, int k) {
long long count = 0;
priority_queue<int> Q(nums.begin(), nums.end());
while (k) {
auto top = Q.top();
Q.pop();
count += top;
Q.push(ceil(top / 3.0));
k--;
}
return count;
}
#endif //LEECODE_C_Q2530_H