[20250723] BOJ / G5 / 핑거 스냅 / 이종환 #534
Merged
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.
🧷 문제 링크
https://www.acmicpc.net/problem/17394
🧭 풀이 시간
30분
👀 체감 난이도
✏️ 문제 설명
전 우주의 생명체 수를 현재의 절반으로 한다.
전 우주의 생명체 수를 현재의 1/3로 한다.
(위의 두 경우에서, 나누어 떨어지지 않으면 몫만 남기고, 나머지는 버린다.)
전 우주의 생명체 수를 현재보다 하나 늘린다.
전 우주의 생명체 수를 현재보다 하나 줄인다.
(이미 전 우주의 생명체 수가 0이라면 할 수 없다.)
매 테스트케이스에서 목표범위 내의 소수로 만드는 데 필요한 최소한의 핑거 스냅의 횟수를 구하자.
🔍 풀이 방법
에라스토테네스의 체 + dp를 하면 되는 문제다.
⏳ 회고
나름 알아두면 괜찮은 방법 두개를 같이 쓰면 되는 문제다. 좋은 문제.