Skip to content

Commit

Permalink
solve : 10814 나이순 정렬
Browse files Browse the repository at this point in the history
  • Loading branch information
wwan13 committed May 7, 2024
1 parent 956c305 commit 87c8a33
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions python/boj_10814.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import sys

input = sys.stdin.readline


def solution(n, data):
return sorted(data, key=lambda x: (x[0], x[2]))


def display_result(answer):
for e in answer:
print(e[0], e[1])


def main():
n = int(input())
data = list()
for i in range(n):
age, name = map(str, input().split())
data.append([int(age), name, i])
answer = solution(n, data)
display_result(answer)


main()

0 comments on commit 87c8a33

Please sign in to comment.