백준 13413

Baekjoon

[백준] 13413 오셀로 재배치 (실버4)

문제요약 나의 코드 및 설명 t = int(input()) for test_case in range(1, t+1): n = int(input()) first_list = list(input()) goal_list = list(input()) compare = [] for i in range(n): if first_list[i] != goal_list[i]: #초기 상태와 목표 상태가 다를 때, compare.append(first_list[i]) #다른 말을 리스트에 넣는다. print(max(compare.count("W"),compare.count("B"))) #W와 B중 많은 것의 개수를 출력한다. 피드백 시간초과가 뜨는 바람에 결국 다른 사람의 코드를 참고하였다. 처음에 이 풀이를 보았을 때 이해..

hellosonic
'백준 13413' 태그의 글 목록