-
[5648] 역원소 정렬 (Python)[Python] 알고리즘/Silver 2021. 11. 2. 21:44
[문제]
https://www.acmicpc.net/problem/5648
알고리즘 분류는 구현, 정렬 입니다.
입력의 끝은 EOF(End Of File) 입니다.
[코드]
import sys li = list() cnt = 0 while 1: try: ins = input() if ins == -1: break else: i_sp = ins.split() for i in i_sp: if cnt != 0: i = "".join(reversed(i)).lstrip("0") li.append(int(i)) cnt += 1 except EOFError: break res = sorted(li) for i in res: print(i)
'[Python] 알고리즘 > Silver' 카테고리의 다른 글
[9996] 한국이 그리울 땐 서버에 접속하지 (Python) (0) 2021.11.04 [1900] 레슬러 (Python) (0) 2021.11.03 [1935] 후위 표기식2 (Python) (0) 2021.11.01 [11478] 서로 다른 부분 문자열의 개수 (Python) (0) 2021.10.31 [10815] 숫자 카드 (Python) (0) 2021.10.29