Advertisement
Nenogzar

01. Climb The Peaks

Jun 1st, 2024
697
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.12 KB | None | 0 0
  1. from collections import deque
  2.  
  3. climbing_peak = {
  4.     'Vihren': 80,
  5.     'Kutelo': 90,
  6.     'Banski Suhodol': 100,
  7.     'Polezhan': 60,
  8.     'Kamenitza': 70,
  9. }
  10.  
  11. conquered_peaks = {
  12.     'Vihren': 0,
  13.     'Kutelo': 0,
  14.     'Banski Suhodol': 0,
  15.     'Polezhan': 0,
  16.     'Kamenitza': 0,
  17. }
  18.  
  19. food_supplies = deque(map(int, input().split(", ")))
  20. daily_stamina = deque(map(int, input().split(", ")))
  21.  
  22. days = 1
  23.  
  24. while food_supplies and daily_stamina and days <= 7:
  25.     day_food = food_supplies.pop()
  26.     day_stamina = daily_stamina.popleft()
  27.  
  28.     dayly_peak = day_food + day_stamina
  29.  
  30.     for climbing, peak in climbing_peak.items():
  31.         if dayly_peak >= peak:
  32.             conquered_peaks[climbing] += 1
  33.  
  34.     days += 1
  35.  
  36. all_peaks_conquered = all(count > 0 for count in conquered_peaks.values())
  37.  
  38. if all_peaks_conquered:
  39.     print("Alex did it! He climbed all top five Pirin peaks in one week -> @FIVEinAWEEK")
  40.     print("Conquered peaks:")
  41.     print("\n".join(peak for peak, count in conquered_peaks.items() if count > 0))
  42. else:
  43.     print("Alex failed! He has to organize his journey better next time -> @PIRINWINS")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement