728x90
반응형

VERSION 2.0
import sys
A = list(sys.stdin.readline().rstrip())
A = sorted(list(map(int , A)) , reverse= True)
print("".join(map(str, A)))
==> "".join(map(srt, A)) ==> 형태 기억하기!!
VERSION 1.0
import sys
a = list(sys.stdin.readline().rstrip())
b = sorted(a ,reverse=True)
for i in b:
print(i,end='')
a = ['2' ,'1','4' ,'3']
a값 리스트로 받는거 추후 정리!!!!!!
==>
https://knowallworld.tistory.com/112
★코테에서 꼭 쓰이는★ 헷갈리는 문자열 정리
import sys #입력 216 N = int(sys.stdin.readline()) print(N) #출력 : 216 print(list(map(int,str(N)))) #출력 : [2,1,6] #입력 216 M = list(map(int ,sys.stdin.readline().rstrip())) print(M) #출력 : [2,1,6] O = list(map(str, sys.stdin.readline().rstri
knowallworld.tistory.com
728x90
반응형
'Python(백준) > 정렬' 카테고리의 다른 글
| [백준 파이썬 11651번]좌표 정렬하기 2★우선순위 힙 사용하기★SORTED()★리스트 a로 받아오기 (0) | 2023.04.09 |
|---|---|
| [백준 파이썬 11650번]좌표 정렬하기★문자열 받기★우선순위 힙으로 풀기★SORTED()★리스트 a로 받아오기★VER2.0 (0) | 2023.04.09 |
| [백준 파이썬 10989번]수 정렬하기3★리스트 생성후 값 할당★VER3.0★ (1) | 2023.04.09 |
| [백준 파이썬 2751번]수 정렬하기2★삽입,버블 정렬 추후에 해보기★우선순위 힙 사용해보기★VER 2.0 (0) | 2023.04.09 |
| [백준 파이썬 25305번]커트라인★SORTED()★우선순위 큐로 풀어보기★VER2.0 (0) | 2023.04.09 |