deushiro

Untitled

Apr 1st, 2021
562
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. dates = {}
  2.  
  3. with open('input.txt') as f:
  4.     for line in f:
  5.         line = line.split()
  6.         if len(line) < 3:
  7.             continue
  8.         date = s[0]
  9.         time = s[1]
  10.         price = int(s[2])
  11.         if(date not in dates):
  12.             dates[date] = []
  13.         dates[date].append(price)
  14.  
  15. answer = 1
  16. for date in dates:
  17.     minmax = 1
  18.     for i in range(len(dates[date])):
  19.         for j in range(i + 1, len(dates[date])):
  20.             minmax = max(minmax, dates[date][j] / dates[date][i])
  21.     answer *= minmax
  22. answer -= 1
  23. answer *= 100
  24. print(answer)
  25.            
  26.    
  27.    
  28.  
Advertisement
Add Comment
Please, Sign In to add comment