You are viewing a single comment's thread. Return to all comments →
sizecount = int(input()) sizes=list(map(int,input().split())) custcount = int(input()) price=[]
for i in range(custcount): x=list(map(int,input().split())) if x[0] in sizes: price.append(x[1]) sizes.remove(x[0])
print(sum(price))
Seems like cookies are disabled on this browser, please enable them to open this website
collections.Counter()
You are viewing a single comment's thread. Return to all comments →
sizecount = int(input()) sizes=list(map(int,input().split())) custcount = int(input()) price=[]
for i in range(custcount): x=list(map(int,input().split())) if x[0] in sizes: price.append(x[1]) sizes.remove(x[0])
print(sum(price))