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