[이준희-2학기 1주차 알고리즘 스터디] #101
Open
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반 알고리즘 스터디 2학기 1주차 [이준희]
📌 문제 풀이 개요
✅ 문제 해결 여부
💡 풀이 방법
문제 1: 스도쿠
문제 난이도
골드 4
문제 유형
구현, 백트래킹
접근 방식 및 풀이
너무나 유명한 스도쿠에 대한 구현 문제였습니다.
백트래킹을 활용하여 풀었습니다.
row, col, box 에서 각각 해당 숫자가 있는지 판단할 수 있는 boolaean 배열을 3개 활용했습니다.
문제 2: 문자열 폭발
문제 난이도
골드 4
문제 유형
자료구조, 문자열
접근 방식 및 풀이
처음에는 java String의 replace를 활용하여 풀었습니다.
위 방식으로 풀었을 때 메모리 초과가 발생하여 다른 방식을 찾아보다가
힌트를 얻어서 풀었습니다.
string을 한글자씩 받고 폭발 문자열보다 길이가 긴 경우 폭발 문자열 길이만큼만 체크하여 폭발시키는 방식으로 풀이하였습니다.
문제 3: 이건 꼭 풀어야 해!
문제 난이도
실버 3
문제 유형
정렬, 누적합
접근 방식 및 풀이
Arrays.sort()를 활용해 비내림차순으로 정렬하고
구간합을 구해놓은 후 주어진 입력대로 출력했습니다.
문제 4: 놀이 공원
문제 난이도
골드 1
문제 유형
이분탐색
접근 방식 및 풀이
이분탐색을 통해 줄서있는 모든 아이가 놀이기구에 탑승하는 시간을 구한 후
그 직전 시간의 상태를 이용하여 풀이했습니다.
문제 5: 저울
문제 난이도
골드 4
문제 유형
그래프 이론, 플로이드-워셜
접근 방식 및 풀이
무거운 경우는 1, 가벼운 경우는 2로 표시한 2차원 배열을
방향이 있는 플로이드-워셜 처럼 구현하여 풀었습니다.