题解 | #欢迎入营#

欢迎入营

https://ac.nowcoder.com/acm/problem/219876

当时写的超时了,其实还是挺简单的
n = int(input())
student = [int(i) for i in input().strip().split()]
taxi = [int(i) for i in input().strip().split()]
student.sort(reverse=True)
taxi.sort(reverse=True)
ans = 1
pos = 0
for i in range(n):
    while pos <= n-1 and taxi[pos] >= student[i]:
        pos += 1
    ans = ans * (pos-i) % 100000007
print(ans)


全部评论

相关推荐

12-08 15:35
浙江大学 Java
点赞 评论 收藏
分享
10-31 20:07
门头沟学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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