You are viewing a single comment's thread. Return to all comments →
k = int(input()) shoes_sizes = list(map(int, (input().split()))) cus_num = int(input()) print(sum( int(x[1]) for x in (input().split() for _ in range(cus_num)) if int(x[0]) in shoes_sizes and not shoes_sizes.remove(int(x[0])) ))
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 →