We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
0 parents commit 0b303f0Copy full SHA for 0b303f0
collections.Counter()
@@ -0,0 +1,12 @@
1
+from collections import Counter
2
+n = int(input())
3
+shoe_size = list(map(int,input().split()))
4
+shoe_count = Counter(shoe_size)
5
+customers = int(input())
6
+totalcost = 0
7
+for _ in range(customers):
8
+ size,amount = map(int,input().split())
9
+ if size in shoe_count.keys() and shoe_count[size]!=0:
10
+ totalcost+=amount
11
+ shoe_count[size] -=1
12
+print(totalcost)
0 commit comments