We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
collections.Counter()
collections.Counter()
+ 0 comments shoes=int(input()) shoe_size=list(map(int,input().split())) customer=int(input()) list=[] for i in range(customer): shoe,price=input().split() list.append([int(shoe),int(price)]) final_list=[] for i in list: for j in shoe_size: if i[0]==j: shoe_size.remove(j) final_list.append(i[1]) break print(sum(final_list))
+ 0 comments import collections input() shoes = collections.Counter(map(int, input().split())) money = 0 for i in range(int(input())): size, price = map(int, input().split()) if shoes[size]: money += price shoes[size] -= 1 print(money)
+ 0 comments from collections import Counter revenue = 0 X = int(input()) stock = Counter(map(int,input().split())) for _ in range(int(input())): size, price = map(int,input().split()) if stock.get(size): revenue += price stock[size] -= 1 print(revenue)
+ 0 comments from collections import Counter X = int(input()) shoe_list = input().split() new_shoe_list = [] for i in shoe_list: i = int(i) new_shoe_list.append(i) N = int(input()) counter_dict = dict(Counter(new_shoe_list)) pisal = 0 for i in range(N): shoe_size, quantity = map(int, input().split()) if shoe_size in counter_dict.keys(): if counter_dict[shoe_size] != 0: counter_dict[shoe_size] -= 1 pisal += quantity print(pisal)
+ 0 comments from collections import Counter
X = int(input()) shoe_list = input().split() new_shoe_list = []
for i in shoe_list: i = int(i) new_shoe_list.append(i)
N = int(input()) counter_dict = dict(Counter(new_shoe_list)) pisal = 0
for i in range(N): shoe_size, quantity = map(int, input().split())
if shoe_size in counter_dict.keys(): if counter_dict[shoe_size] != 0: counter_dict[shoe_size] -= 1 pisal += quantity
print(pisal)
Load more conversations
Sort 1179 Discussions, By:
Please Login in order to post a comment