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