You are viewing a single comment's thread. Return to all comments →
Completed using the methods in the documentation:
import collections X = int(input()) c = collections.Counter(map(int, input().split())) N = int(input()) total = 0 for i in range(N): s,p = map(int, input().split()) if c[s]: c.subtract([s]) c += collections.Counter() # This removes any 0 counts, as mentioned in documentation total += p print(total)
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 →
Completed using the methods in the documentation: