Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- stars = []
- for _ in range(n):
- star_list = [int(i) for i in input().split()]
- stars.append({'start': star_list[0], 'end': star_list[1], 'desirability': star_list[2]})
- # list of lists of stars
- all_overlapping = []
- for star in stars:
- star_overlapping = []
- for other_star_index in range(len(stars)):
- other_star = stars[other_star_index]
- if star == other_star:
- continue
- if (star['start'] >= other_star['start'] and star['start'] <= other_star['end'] or
- star['end'] >= other_star['start'] and star['end'] <= other_star['end']):
- star_overlapping.append(other_star_index)
- all_overlapping.append(star_overlapping)
- def get_max_desirability(args):
- max_arg_desirability = -1
- max_arg_index = 0
- for index in args:
- if
- max_desirabilities = []
- for i in range(len(all_overlapping)):
- max_desirabilities.append(get_max_desirability(all_overlapping[i]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement