-
Notifications
You must be signed in to change notification settings - Fork 3
[정민서-10주차 알고리즘 스터디] #12
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/week10
Choose a base branch
from
minseojeong1012:main
base: minseojeong/week10
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
[정민서-10주차 알고리즘 스터디] #12
minseojeong1012
wants to merge
50
commits into
SSAFY13th-algorithm:minseojeong/week10
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반 알고리즘 스터디 10주차 [정민서]
📌 문제 풀이 개요
✅ 문제 해결 여부
💡 풀이 방법
문제 1: 최소 스패닝 트리
문제 난이도
골드 4
문제 유형
그래프
접근 방식 및 풀이
이번주에 배운 내용이라 어렵지 않게 풀었습니다. union 과 find 메서드를 활용하여 해결하였습니
문제 2: 파티
문제 유형
그래프
문제 난이도
골드 3
접근 방식 및 풀이
각 학생이 파티 장소 X로 가서 다시 돌아올 때 걸리는 최단 시간 중 가장 긴 시간을 구하는 문제기에 다익스트라 알고리즘을 활용하였습니다.
가중치를 고려하여 트리를 구현하고 x에서 각 정점으로 가는 최단 경로를 구하고, 간선의 방향을 반대로 해 각 정점에서 x로 가는 최단경로를 구하였습니다.
문제 3: 쉬운 최단거리
문제 유형
그래프
문제 난이도
실버 1
접근 방식 및 풀이
최단거리를 구하는 문제이기에 bfs를 사용해서 거리를 기록했습니다. 0은 이동할 수 없는 칸이기에 예외상황을 두고 거리를 구했습니다
문제 4: 경로찾기
문제 유형
그래프
문제 난이도
실버 1
접근 방식 및 풀이
플로이드 워셜 알고리즘을 사용하였습니다. k 를 거쳐 i에서 j로 갈수 있는 경로가 존재하는지 확인하고, 만약 graph[i][k] == 1 && graph[k][j] == 1 이라면 graph[i][j] = 1; 이렇게 갱신을 하여 반복문을 돌렸습니다.
문제 5: 뱀과 사다리 게임
문제 유형
그래프
문제 난이도
골드 5
접근 방식 및 풀이
1번칸에서 100번 칸으로 가기 위한 최소 횟수이므로 bfs를 사용하였습니다.
주사위는 6가지의 경우의 수가 있기에 반복문을 돌리면서 시물레이션 하였습니다. 사다리나 뱀을 만나면 해당 위치로 이동하고, 이동횟수를 기록하였습니다.