成熟的小辣鸡开挂了 level
获赞
12
粉丝
3
关注
0
看过 TA
322
门头沟学院
2024
测试开发
IP属地:新疆
暂未填写个人简介
私信
关注
2023-11-09 12:50
门头沟学院 测试开发
0 点赞 评论 收藏
分享
2023-11-04 21:48
门头沟学院 测试开发
0 点赞 评论 收藏
分享
2023-10-16 16:09
门头沟学院 测试开发
药丸丹辣:说一周给结果,我都十天了
投递传音控股等公司9个岗位
0 点赞 评论 收藏
分享
2023-09-25 16:36
门头沟学院 测试开发
import mathfrom typing import Listclass Solution:    def combinationSum2(self, candidates: List[int], target: int, people:int):        if sum(candidates)             return []        candidates.sort()        jieguo = list()        res = list()        self.abc(jieguo, res, target,candidates, 0, people)        return jieguo, len(jieguo)    def abc(self,jieguo, res, target,candidates, index, people): if sum(res) >= target and len(res) == people:            jieguo.append(res[:])            return elif len(res) > people:            return        for i in range(index, len(candidates)):            res.append(candidates[i])            self.abc(jieguo, res, target,candidates, i+1, people)            res.pop()        a = Solution()n = int(input())for i in range(n):    m, target = map(int, input().split())    num = int(math.ceil(m/2))    can = list(map(int, input().split()))    print(a.combinationSum2(can, target, num))
投递360集团等公司9个岗位
0 点赞 评论 收藏
分享
2023-08-18 08:50
门头沟学院 测试开发
投递字节跳动等公司9个岗位
0 点赞 评论 收藏
分享

创作者周榜

更多
关注他的用户也关注了:
牛客网
牛客企业服务