This repository was archived by the owner on Mar 18, 2024. It is now read-only.
[2023-08-18] wooyeol #114 #135
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Summary
종이의 개수
https://www.acmicpc.net/problem/1780
풀이시간
08:30 ~ 09:30 + 13:30~14:44 (2시간 14분)
N(1 <= N <= 37, N은 3k 꼴)
접근법
무슨 알고리즘으로 풀이 할 수 있을까? 재귀 / 분할 정복
문제에는 두 가지 조건이 주어진다. 첫 번째는 9개의 값이 같은 값이라면 그 종이는 하나
9개의 값이 다른 경우 그 종이는 각각 하나의 종이씩이다.
그렇기에 범위 내의 데이터가 모두 같을 경우와 같지 않을 경우를 검사하고 같지 않다면
9개로 나눠서 다시 연산 진행 3N 으로 주어지기에 3(N-1)의 경우 다시 검사하여
9개로 나눠진 값이 각각 하나씩만 반환할 때까지 분할해서 정복한다.
풀이 참조 : https://velog.io/@yje876/python백준분할정복-1780-종이의-개수