분류 전체보기 316

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

music = raw_input()music_list = music.split(" ")start_num = int(music_list.pop(0))result = Noneif 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_nu..

Algorithm/Baekjoon 2019.01.17
반응형