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()
Sort by
recency
|
1316 Discussions
|
Please Login in order to post a comment
rom collections import Counter
number_of_shoes = int(input()) size_of_shoes = list(map(int, input().split())) number_of_customers = int(input())
counter_of_sizes= Counter(size_of_shoes)
total =0 for customer in range (number_of_customers): size, price = list(map(int, input().split())) if size in counter_of_sizes.keys(): if counter_of_sizes[size] > 0: total = total + price counter_of_sizes[size] = counter_of_sizes[size] -1 print (total)
`X=int(input()) a=list(map(int, input().split())) N=int(input()) c=0 for i in range(N): k=list(map(int, input().split())) if k[0] in a: c=c+k[1] a.remove(k[0]) print(c)
X=int(input("Enter the number of shoes: ")) S=[int(sz) for sz in input("Enter the available sized separated by space: ").split()] N=int(input("Enter the number of customers: ")) p={} mny=0 for i in range(N): k=input("Enter size and price separated by space: ").split() a, b = int(k[0]), int(k[1]) if a in S: mny+=b S.remove(a)
print(mny)
It is working in my IDE but when I try to submit it says wrong answer. When I submit the same test input as a custom input it works. I feel like there is a bug or something. What do you think guys?