Algorithm/Baekjoon

백준 단계별로 풀기 6단계 1차원 배열 사용하기 - 음계 (2920 문제) Python 2 답안

Bonita SY 2019. 1. 17. 23:05
728x90
반응형

music = raw_input()

music_list = music.split(" ")

start_num = int(music_list.pop(0))

result = None

if start_num == 1:

        result = "ascending"

        for m in music_list:

                if (start_num != 1) and ((start_num + 1) != int(m)):

                        result = "mixed"

                        break

                start_num = int(m)

elif start_num == 8:

        result = "descending"

        for m in music_list:

                if (start_num != 8) and ((start_num - 1) != int(m)):

                        result = "mixed"

                        break

                start_num = int(m)

else:

        result =  "mixed"


print result

728x90
반응형