-
Notifications
You must be signed in to change notification settings - Fork 3
[정민서-13주차 알고리즘 스터디] #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
minseojeong1012
wants to merge
50
commits into
SSAFY13th-algorithm:minseojeong/week13
Choose a base branch
from
minseojeong1012:main
base: minseojeong/week13
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[정민서-13주차 알고리즘 스터디] #21
minseojeong1012
wants to merge
50
commits into
SSAFY13th-algorithm:minseojeong/week13
from
minseojeong1012:main
Conversation
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🚀 싸피 15반 알고리즘 스터디 13주차 [정민서]
📌 문제 풀이 개요
✅ 문제 해결 여부
💡 풀이 방법
문제 1: 스티커
문제 난이도
실버 1
문제 유형
dp
접근 방식 및 풀이
스티커를 하나뜯으면 그 스티커와 인접한(대각선, 위., 아래) 스티커는 사용할 수없기에
윗줄 스티커를 선택했을 때 최대 점수와 아랫줄 스티커를 선택했을 때 최대 점수를 구분해서 dp로 구현했습니다.
문제 2: 곱셈
문제 유형
분할정복
문제 난이도
실버 1
접근 방식 및 풀이
분할정복을 통해서 거듭제곱 계산하였습니다
지수를 반으로 나누고, 짝수일 경우 반환, 홀수면 a를 한번 더 곱하는 방식으로 해결했습니다
문제 3: 벽 부수고 이동하기
문제 유형
그래프
문제 난이도
골드 3
접근 방식 및 풀이
일반적인 bfs로 진행하였습니다.
차별점은 벽을 부셨는지 여부를 확인해야 하므로 3차원 visited 배열로 상태를 관리하였습니다
문제 4: 웜홀
문제 유형
그래프
문제 난이도
골드 3
접근 방식 및 풀이
일반적인 bfs로는 음수를 확인할 수 없습니다. 따라서 벨만포드 알고리즘을 사용하여 음수 사이클을 관리하였습니다.
문제 5: 숨바꼭질 3
문제 유형
그래프
문제 난이도
골드 5
접근 방식 및 풀이
이 문제는 0-1bfs 라는 개념을 사용해 해결했습니다. 일반적으로 bfs는 모든 가중치가 같을 때 사용하지만 0-1bfs는 가중치 값이 다릅니다.
따라서 덱을 활용하여 0은 앞쪽에 1은 뒤쪽에 추가하면서 가중치를 관리하였습니다.