#include <leetcode.h>
◆ maximumCandies()
int leetcode::maximum_candies_allocated_to_k_children::Solution::maximumCandies |
( |
vector< int > & |
candies, |
|
|
long long |
k |
|
) |
| |
|
static |
在文件 leetcode.cpp 第 5581 行定义.
5582 sort(candies.begin(), candies.end());
5584 for(
const auto candy: candies) {
5594 unsigned long long count = 0;
5595 for(
auto it = candies.rbegin(); it != candies.rend() && *it >= r; ++it) {
5606 const int m = (l + r) / 2;
5607 unsigned long long count = 0;
5608 for(
auto it = candies.rbegin(); it != candies.rend() && *it >= m; ++it) {
5616 }
else if(count < k) {
被这些函数引用 leetcode::maximum_candies_allocated_to_k_children::TEST().
该类的文档由以下文件生成: