반응형
문제 설명
https://www.acmicpc.net/problem/2920
제출한 코드
num_list = list(map(int, input().split()))
total = 0
for i in range(len(num_list)) :
if num_list[i]==i+1 :
total += 1
elif num_list[i]==len(num_list)-i :
total -= 1
if total > 7 :
print("ascending")
elif total < -7 :
print("descending")
else :
print("mixed")
결과
후기
반응형
'BQJ 백준 > python' 카테고리의 다른 글
[Python/파이썬] 백준 3003번: 킹, 퀸, 룩, 비숍, 나이트, 폰 (0) | 2024.07.17 |
---|---|
[Python/파이썬] 백준 2941번: 크로아티아 알파벳 (0) | 2024.07.17 |
[Python/파이썬] 백준 2908번: 상수 (0) | 2024.07.12 |
[Python/파이썬] 백준 2884번: 알람 시계 (0) | 2024.07.12 |
[Python/파이썬] 백준 2869번: 달팽이는 올라가고 싶다 (0) | 2024.07.11 |