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.
A: string으로 받은 뒤 size() 메서드로 문자열 길이를 구한 뒤 mod 5로 확인했습니다.
B: 건물 개수만큼 0으로 초기화한 벡터를 만든 뒤 B-1 인덱스인 곳은 값을 더해주고 A-1 인 곳은 값을 빼주고 마지막에 전체 출력했습니다.
C: 처음에 단순하게 벡터로 push_back한 뒤 다시 정렬하고 만약 값을 지워야 하면 해당 값의 upper_bound로 it를 받은 뒤 남은 뒷 부분을 다시 새로운 벡터로 받아서 교체해주는 식으로 만들었는데 생각해보니 저번에 배웠던 우선순위 큐 min_heap으로 하면 훨씬 간단해질꺼 같아서 방향을 틀어서 바꾸었습니다.
D: 계산기로 2의 거듭제곱 개수를 구해보니 많지 않아 이걸 string으로 바꾼뒤 값들을 키워가며 체크하면 될꺼같은데 크기 순서대로 어떻게 할지를 전혀 감을 못 잡았습니다.