[20250620] BOJ / P4 / blobfearful / 권혁준 #372
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/24503
🧭 풀이 시간
17분
👀 체감 난이도
✏️ 문제 설명
블롭은 날마다 양이 늘어난다. i일차에는 그 전날에 있던 양의 i배만큼 늘어난다. (i > 1)
1일차에 있던 블롭의 수가 주어지면, 블롭의 수가 처음으로 K의 배수가 되는 일차를 구해보자.
총 Q번의 질문에 답해야 함.
🔍 풀이 방법
1일차에 x마리가 존재했다면, m일차에는 xm! 만큼 존재한다.
xm!의 소인수 목록이 K의 소인수 목록을 완전히 포함하는 일차를 구하면 된다.
K를 미리 소인수분해 해놓는다.
그 다음, 각 질문에 대해 x*m!에서 K의 소인수에 대해서만 확인해주면 되고, 각 소인수가 모두 포함되는 일차 중 최댓값을 출력하면 된다.
⏳ 회고
재밌당