携程测开笔试第二道编程

题目是领导分配任务,我用PYTHON写的,不知道为什么只过了57%,想不通,有大佬可以给我分析分析吗,非常感谢
import sys
value=list(map(int,sys.stdin.readline().strip().split()))
task=list(map(int,sys.stdin.readline().strip().split()))
if len(task)==0 or len(value)==0:
    print ('0')
res=[]
for i in range(len(task)):
    num=0
    for j in range(len(value)):
        if task[i]>=value[j]:
            num+=1
    res.append(num)
if max(res)>=len(task):
    result=len(task)
else:
    result=max(res)
print (result)

#笔试题目##携程#
全部评论
def func(nums1,nums2):           nums1.sort()           nums2.sort()           res = 0           while nums1 and nums2:                  if nums[-1] <= nums[-1]:                            res += 1                            nums1.pop()                            nums2.pop()                   else:                            nums1.pop()           return res
点赞 回复 分享
发布于 2020-09-09 10:55
大佬告诉我SQL怎么写的
点赞 回复 分享
发布于 2020-09-08 22:04
我也57
点赞 回复 分享
发布于 2020-09-08 21:56
我只过了43%😑
点赞 回复 分享
发布于 2020-09-08 21:54
你第二个for循环没有更新,每次都是从头扫描。 1 2 3 4 5 5 0 0 5>1,5>2,,5>3,5>4
点赞 回复 分享
发布于 2020-09-08 21:50

相关推荐

05-12 17:28
已编辑
门头沟学院 硬件开发
ldf李鑫:不说公司名祝你以后天天遇到这样的公司
点赞 评论 收藏
分享
05-29 20:34
门头沟学院 C++
KarlAllen_直通春招版:得做好直接春招的准备。学历差的话,一是面试要求会比学历好的严格不少,二是就算面试通过了也会被排序。总之暑期和秋招对于学历差的就是及其不友好
点赞 评论 收藏
分享
评论
2
2
分享

创作者周榜

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