This repository was archived by the owner on Mar 18, 2024. It is now read-only.
[2023-08-18] wooyeol #114#135
Merged
Merged
Conversation
Closed
zsmalla
approved these changes
Aug 18, 2023
Contributor
zsmalla
left a comment
There was a problem hiding this comment.
전반적으로 직관적으로 코드를 구성하셔서 개인적으로 이해하기 정말 편했습니다. 고생하셨습니다~
Contributor
There was a problem hiding this comment.
이 친구들도 마찬가지로 직관적이어서 좋습니다! 다만 보는 관점에 따라서 해당 9개의 경우의 수를 반복문으로 작성하는 경우를 좋게 보는 분들도 계실 것 같네요. 시간 날 때 한 번 개선해보시면 좋을 것 같습니다!
Contributor
There was a problem hiding this comment.
지수님 말씀처럼 저는 이 부분을 반복문으로 구현해서 풀었는데 반복문으로 써보시면 코드가 좀 더 간결해보일 수 있을 것 같아요!
ksumini
approved these changes
Aug 18, 2023
Contributor
There was a problem hiding this comment.
지수님 말씀처럼 저는 이 부분을 반복문으로 구현해서 풀었는데 반복문으로 써보시면 코드가 좀 더 간결해보일 수 있을 것 같아요!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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-종이의-개수