题解 | 讨厌鬼进货

讨厌鬼进货

https://www.nowcoder.com/practice/e364bac751204aa0b2d27389ca8e3c94

# 定义两个整数,分别表示需要订购的货物种类,和方式三一次性购入的花费
n,x = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = []
for i in range(n):
    if A[i]<=B[i]:
        C.append(A[i])
    else:
        C.append(B[i])
print(min(sum(A),sum(B),sum(C),x))

全部评论

相关推荐

饿魔:你这为什么gap了半年啊
点赞 评论 收藏
分享
02-11 14:29
已编辑
字节跳动_QA
Edgestr:这种的写代码最狠了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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