Skip to content

ABC451 / mshuun#37

Open
mshuun wants to merge 4 commits intoPNU-PULSE:mainfrom
mshuun:main
Open

ABC451 / mshuun#37
mshuun wants to merge 4 commits intoPNU-PULSE:mainfrom
mshuun:main

Conversation

@mshuun
Copy link
Copy Markdown
Contributor

@mshuun mshuun commented Mar 28, 2026

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를 활용한 풀이를 떠올렸지만, 시간 부족으로 코드 작성까지 이어지지는 못했습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant