본문 바로가기
python-algorithm

[백준] 2920

by 무적김두칠 2021. 1. 8.

1
2
3
4
tmp=list(map(int, input().split()))
if tmp ==sorted(tmp): print("ascending")
elif tmp ==sorted(tmp,reverse=True):print("descending")
elseprint ("mixed")
cs

한마디로 오름차순, 내림차순으로 돼있는지 묻는 문제입니다.
내장함수 sorted 이용하시면 됩니다.

반응형

'python-algorithm' 카테고리의 다른 글

[백준] 3059  (0) 2021.01.08
[백준] 3052  (0) 2021.01.08
[백준] 2908  (0) 2021.01.08
[백준] 2869  (0) 2021.01.08
[백준] 2798  (0) 2021.01.08

댓글