|
|
back to boardAC on python tovars,prices,recomendations= [],[],[] for i in range(6): name = input() tovar = input() price = int(input()) if tovar in tovars: if prices[tovars.index(tovar)] > price: prices[tovars.index(tovar)] = price recomendations[tovars.index(tovar)] +=1 else: tovars.append(tovar) prices.append(price) recomendations.append(1) if recomendations.count(max(recomendations)) == 1: print(tovars[recomendations.index(max(recomendations))]) else: ans = [] ans1 = [] l = len(tovars) mm = max(recomendations) for i in range(l): if recomendations[i] == mm: ans.append(tovars[i]) ans1.append(prices[i]) print(ans[ans1.index(min(ans1))]) |
|
|