problemscpp
A collection of my answers to algorithm problems in c++.
| 函数
leetcode::maximum_candies_allocated_to_k_children 命名空间参考

  1. Maximum Candies Allocated to K Children
更多...

class  Solution
 

函数

 TEST (maximum_candies_allocated_to_k_children, case1)
 
 TEST (maximum_candies_allocated_to_k_children, case2)
 
 TEST (maximum_candies_allocated_to_k_children, case3)
 
 TEST (maximum_candies_allocated_to_k_children, case4)
 

详细描述

  1. Maximum Candies Allocated to K Children
  1. 每个小孩最多能分到多少糖果

函数说明

◆ TEST() [1/4]

leetcode::maximum_candies_allocated_to_k_children::TEST ( maximum_candies_allocated_to_k_children  ,
case1   
)

在文件 leetcode_test.cpp2678 行定义.

2678 {
2679 vector candies = {5, 8, 6};
2680 ASSERT_EQ(5, Solution::maximumCandies(candies, 3));
2681 }

引用了 leetcode::maximum_candies_allocated_to_k_children::Solution::maximumCandies().

◆ TEST() [2/4]

leetcode::maximum_candies_allocated_to_k_children::TEST ( maximum_candies_allocated_to_k_children  ,
case2   
)

在文件 leetcode_test.cpp2683 行定义.

2683 {
2684 vector candies = {2, 5};
2685 ASSERT_EQ(0, Solution::maximumCandies(candies, 11));
2686 }

引用了 leetcode::maximum_candies_allocated_to_k_children::Solution::maximumCandies().

◆ TEST() [3/4]

leetcode::maximum_candies_allocated_to_k_children::TEST ( maximum_candies_allocated_to_k_children  ,
case3   
)

在文件 leetcode_test.cpp2688 行定义.

2688 {
2689 vector candies = {1, 2, 3, 4, 10};
2690 ASSERT_EQ(3, Solution::maximumCandies(candies, 5));
2691 }

引用了 leetcode::maximum_candies_allocated_to_k_children::Solution::maximumCandies().

◆ TEST() [4/4]

leetcode::maximum_candies_allocated_to_k_children::TEST ( maximum_candies_allocated_to_k_children  ,
case4   
)

在文件 leetcode_test.cpp2693 行定义.

2693 {
2694 vector candies = {123, 13300, 1000, 23, 11, 41, 311};
2695 ASSERT_EQ(15, Solution::maximumCandies(candies, 980));
2696 }

引用了 leetcode::maximum_candies_allocated_to_k_children::Solution::maximumCandies().