Advertisement
horozov86

Climb the peaks

Jun 8th, 2023
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.69 KB | None | 0 0
  1. from collections import deque
  2. daily_portions = [int(x) for x in input().split(', ')]
  3. daily_stamina = deque(int(x) for x in input().split(', '))
  4.  
  5.  
  6. conquered_peaks = []
  7.  
  8. dictionary = {
  9.     'Vihren': 80,
  10.     'Kutelo': 90,
  11.     'Banski Suhodol': 100,
  12.     'Polezhan': 60,
  13.     'Kamenitza': 70
  14. }
  15.  
  16. while daily_stamina:
  17.     position = daily_portions.pop()
  18.     stamina = daily_stamina.popleft()
  19.     sum_position_stamina = position + stamina
  20.    
  21.    
  22.     for peak, difficulty in dictionary.items():
  23.         if sum_position_stamina >= difficulty and peak not in conquered_peaks:
  24.             conquered_peaks.append(peak)
  25.         dictionary[peak] = difficulty
  26.        
  27.    
  28. print(conquered_peaks)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement