题解 | #称砝码#

称砝码

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

import sys

n = int(input())
m=list(map(int,input().split()))
x=list(map(int,input().split()))
res={0}
for i in range(n):
    for j in range(x[i]):
        for k in list(res):
            if m[i]+k not in res:
                res.add(m[i]+k)
print(len(res))

全部评论

相关推荐

积极的小学生不要香菜:你才沟通多少,没500不要说难
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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