You are viewing a single comment's thread. Return to all comments →
from collections import Counter X = int(input()) sizes = Counter(list(map(int, input().split(' ')))) N = int(input()) earning = 0 for i in range(N): size, price = map(int, input().split(' ')) if sizes[size] > 0: sizes[size] -= 1 earning += price else: earning += 0 print(earning)
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 →