Open
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.
AtCoder Beginner Contest 451
A - illegal
문자열의 길이가 5의 배수인지만 확인하면 되는 간단한 문제입니다.
B - Personnel Change
각 인원의 현재 그룹은 -1, 다음 그룹은 +1로 누적하여 풀었습니다.
C - Understory
최소 힙을 사용해 해결했습니다.
추가는 힙에 값을 넣고, 삭제는 기준 이하의 최솟값들을 모두 pop한 뒤 현재 남은 나무 수를 출력했습니다.
D - Concat Power of 2
결과값이 10^9 이하이므로 최대 자릿수가 9자리라는 점을 활용했습니다. 자릿수별로 만들 수 있는 수들을 순서대로 확장해 나가며 생성하는 방식으로 접근했습니다.
예를 들어 2자리 수는 1자리+1자리, 3자리 수는 1자리+2자리와 2자리+1자리, 4자리 수는 1자리+3자리와 2자리+2자리처럼 가능한 모든 수를 짧은 자리 수에서 긴 자리 수 순서대로 구하였습니다.
E - Tree Distance
전날 스터디에서 배운 MST를 활용한 풀이를 떠올렸지만, 시간 부족으로 코드 작성까지 이어지지는 못했습니다.