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