IN = [int(x) for x in input().replace('[', '').replace(']', '').split(',')] times = [] for a in range(6):     for b in range(6):         for c in range(6):             for d in range(6):                 for e in range(6):                     for f in range(6):                         if a != b and a != c and a != d and a != e and a != f and b != c and b != d and b != e and b != f and c != d and c != e and c != f and d != e and d != f and e != f:                             times.append([IN[a] * 10 + IN[b], IN[c] * 10 + IN[d], IN[e] * 10 + IN[f]]) res = [-1, -1, -1] for each in times:     hour = each[0]     m = each[1]     s = each[2]     if hour < 24 and m < 60 and s < 60:         if hour > res[0]:             res[0] = hour             res[1] = m             res[2] = s         elif hour == res[0] and m > res[1]:             res[0] = hour             res[1] = m             res[2] = s         elif hour == res[0] and m == res[1] and s > res[2]:             res[0] = hour             res[1] = m             res[2] = s if sum(res) == -3:     print("invalid") else:     print(str(res[0]).zfill(2) + ':' + str(res[1]).zfill(2) + ':' + str(res[2]).zfill(2))
点赞 评论

相关推荐

Java面试先知:我也是和你一样的情况,hr 说等开奖就行了
点赞 评论 收藏
分享
看起来名字可以很长:笑死 我暑期实习阿里云的意向也被 qq 邮箱放在垃圾箱了
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务