360笔试选气球那题,有没有问题?

# -*- coding: utf-8 -*-
if __name__=='__main__':
    a = int(input())
    res = []
    result=[]
    last=[]
    for i in  range(a):
        a=input()
        num=[int(n) for n in a.split()]
        res.append(num)
    for i in res:
        print(res)
        i.sort()
        sorted(i)
        number=int(i[0])
        l1=i[1]
        l2=i[2]
        l2=l2-number
        l1=l1-number
        l3 = l1 + l2
        while l1>0:
            # print(l3)
            if l1>0 and l2>0 and l3>=3 :
                l1 = l1 - 1
                l2 = l2 - 2
                number = number + 1
            else:
                break
        result.append(number)
        print(result)

全部评论
这题是在线笔试题吧,感觉比我做的头条笔试简单好多。
点赞 回复 分享
发布于 2018-04-01 16:51
常数级时间复杂度 题解: https://blog.csdn.net/bobbymly/article/details/79777973
点赞 回复 分享
发布于 2018-04-01 15:52
确实,同超时+1
点赞 回复 分享
发布于 2018-04-01 15:50
超时了,我试过这样
点赞 回复 分享
发布于 2018-04-01 15:45

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务