Merged
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.
🧷 문제 링크
공약수
🧭 풀이 시간
30분
👀 체감 난이도
✏️ 문제 설명
어떤 두 수의 최대공약수와 최소공배수가 주어질 때 어떤 수 쌍 찾기
수 쌍이 여러개인 경우 두 수의 합이 작은 것을 출력하시오
🔍 풀이 방법
유클리드 호제법..
a * b == gcd * lcm이기 때문에 주어진 두 수를 먼저 곱하기sqrt(gcd * lcm)해서 확인→ 두 약수의 차가 적어야 하기 때문에 반복문 끝까지 진행
i와div / i가 서로소인 것을 확인하고 결과에 저장함→ 서로소여야
a와b가 각각 최대공약수, 최소공배수가 되기 때문에 두 약수의 최대공약수가 1인지 확인하는 과정 필요⏳ 회고
어려워