쇼미더코드 3차

개발/문제풀이

[BOJ 27210, Python] 신을 모시는 사당 풀이

import sys input = sys.stdin.readline s_num = int(input()) s_list = list(map(int,input().split())) m_list = [] before_s = s_list[0] count = 0 if before_s == 1: count += 1 else: count -= 1 for i in range(1,s_num): if s_list[i] != before_s: before_s = s_list[i] m_list.append(count) count = 0 if before_s == 1: count += 1 else: count -= 1 else: if s_list[i] == 1: count += 1 else: count -= 1 m_list.a..

Junhyung-Choi
'쇼미더코드 3차' 태그의 글 목록