题解 | #称砝码#
称砝码
http://www.nowcoder.com/practice/f9a4c19050fc477e9e27eb75f3bfd49c
while True:
try:
n = int(input())
mList = list(map(int, input().split()))
xList = list(map(int, input().split()))
lst = []
for i in zip(mList, xList):
lst += [i[0]] * i[1]
weights = {0}
for i in lst:
for j in list(weights):
weights.add(i+j)
print(len(weights))
except:
break