Notice
Recent Posts
Recent Comments
-
[백준 1181] 단어 정렬 본문
반응형
문제
https://www.acmicpc.net/problem/1181
풀이
n = int(input())
word = []
for _ in range(n):
word.append(input())
words = list(set(word))
words.sort()
words.sort(key=len)
for i in words: print(i)
1. 배열에 단어들을 입력받는다.
2. 단어들을 사전순으로 sort한다.
3. 단어들을 길이순으로 sort한다.
반응형
'Algorithm' 카테고리의 다른 글
[백준 10814] 나이순 정렬 (0) | 2023.04.18 |
---|---|
[백준 7568] 덩치 (1) | 2023.04.17 |
[백준 1541] 잃어버린 괄호 (0) | 2023.01.25 |
[백준] #1373 2진수 8진수 - 파이썬 (0) | 2022.07.14 |
[파이썬] enumerate (0) | 2021.01.26 |
Comments