[유병규-16주차 알고리즘 스터디] #75
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반 알고리즘 스터디 16주차 [유병규]
📌 문제 풀이 개요
✅ 문제 해결 여부
💡 풀이 방법
문제 1: 흩날리는 시험지 속에서 내 평점이 느껴진거야
문제 난이도
문제 유형
접근 방식 및 풀이
k
개의 그룹으로 나누었을 때 각 그룹의 총합의 최솟값의 최댓값을 구하는 문제입니다.mid
로 설정하였습니다. 즉, 각 그룹의 총합은 최소한mid
값을 넘어야 함을 의미합니다.counting
함수는mid
를 전달 받아 수열에서 조건을 만족하는 그룹을 만들 수 있는 개수를 반환합니다.count
값에 따라 다음과 같이 조정합니다.k
보다 작을 경우:mid
값이 너무 큰 것이므로mid
값을 줄인다k
보다 클 경우:mid
값이 너무 작은 것이므로mid
값을 키운다.k
와 같을 경우: 최댓값을 찾는 것이 목표이므로mid
값을 키운다.right
와left
는 다음과 같은 의미를 가집니다.right
: 조건을 만족하는 값들 중 최댓값left
: 조건을 만족하지 않는 값들 중 최솟값right
를 반환하여 문제를 해결하였습니다.문제 2: 구슬 탈출 4
문제 난이도
문제 유형
접근 방식 및 풀이
문제 3: 세부
문제 난이도
문제 유형
접근 방식 및 풀이
문제 4: 커플 만들기
문제 난이도
문제 유형
접근 방식 및 풀이
a<=b
) b개 중에서 a개를 선택해야 하고 이때의 커플 간 성격 차이의 합이 최소가 되어야 하므로 먼저 두 그룹을 정렬하였습니다.i<=j
를 만족해야 합니다.문제 5: Ignition
문제 난이도
문제 유형
접근 방식 및 풀이