You are viewing a single comment's thread. Return to all comments →
from collections import Counter n = int(input()) s = Counter(map(int,input().split())) x = int(input()) total = [] for i in range(x): a,b = map(int,input().split()) if s[a] > 0: total.append(b) s.subtract(Counter([a])) else: pass print (sum(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 →