You are viewing a single comment's thread. Return to all comments →
records = [] if __name__ == '__main__': for _ in range(int(input())): name = input() score = float(input()) records.append([name, score]) records.sort(key=lambda x: (x[1], x[0])) lowest_score = records[0][1] second_lowest_score = None for name, score in records: if score > lowest_score: second_lowest_score = score break second_lowest_names = [name for name, score in records if score == second_lowest_score] second_lowest_names.sort() for name in second_lowest_names: print(name)
Seems like cookies are disabled on this browser, please enable them to open this website
Nested Lists
You are viewing a single comment's thread. Return to all comments →