vipkid 大数据开发笔试编程题

题目很简单,编程的第一个sql只有50%通过率,交了卷问了牛客AC的大佬才知道除了分数排名还要考虑交卷时间。
还是自己没考虑全面,发帖当作一个教训吧。
贴一下两个题的代码:
第一题:
select st_id,st_name from
(select *,sum(score) as sum_score,
strftime ('%s', max(start_time)) - strftime('%s', min(start_time)) as use_time
from S group by st_id order by sum_score,use_time)
limit 1

第二题:
s=input().split()
s[-1]+=","
count=0
res=[]
for i in s:
    if "-"+i in s and i not in res:
        count+=1
        res+=[i,"-"+i]
print(count)


#VIPKID##大数据开发工程师##题解#
全部评论

相关推荐

1 4 评论
分享
牛客网
牛客企业服务