题解 | #称砝码#

称砝码

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))

全部评论

相关推荐

06-17 21:57
门头沟学院 Java
白友:噗嗤,我发现有些人事就爱发这些,明明已读不回就行了,就是要恶心人
点赞 评论 收藏
分享
07-24 16:39
已编辑
门头沟学院 测试开发
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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