Uh oh!
There was an error while loading. Please reload this page.
This repository was archived by the owner on Mar 18, 2024. It is now read-only.
[2023-08-23] wooyeol #142 - #155
Merged
Merged
Conversation
Closed
ksumini
approved these changes
Aug 23, 2023
Contributor
There was a problem hiding this comment.
오 이 부분을 뒤에서부터 나머지의 개수만큼 +1해주는 for문으로 작성해주셨군요..! 저랑 코드만 약간 다르고 거의 비슷한 풀이인 것 같아요~!
MemberAuthor
There was a problem hiding this comment.
수민님꺼를 보면서 더 간단하게 나타낼 수 있구나라고 깨우쳤습니다. 감사합니다!
zsmalla
approved these changes
Aug 23, 2023
zsmalla
left a comment
Contributor
There was a problem hiding this comment.
규칙을 잘 파악하셨고, 코드로 작성하기까지 규칙을 잘 풀어서 설명해주셨기 때문에 코드 이해에 대한 어려움이 없었던 것 같습니다. 고생하셨습니다~
limstonestone
approved these changes
Aug 23, 2023
Contributor
There was a problem hiding this comment.
말씀주신대로 제 풀이보다 반복문 부분이 깔끔하네요!
수민님 풀이를 참고하면 반복문없이 몫과 나머지 부분을 깔끔하게 처리를 할 수 있더라고요!
감사합니다 ~!
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 freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
PR Summary
최고의 집합
https://school.programmers.co.kr/learn/courses/30/lessons/12938
풀이시간
21:46 ~ 22:28 (38분)
문제 조건
자연수의 개수 : 1 ~ 10,000 (n)
모든 원소들의 합 : 1 ~ 100,000,000
시간 복잡도 : O(n)
접근법
무슨 알고리즘으로 풀이 할 수 있을까? -> 단순 구현(수학)
예외처리 구간(최고의 집합이 존재하지 않는 경우) : 모든 원소의 합이 원소의 개수보다 작을 경우에는 최고의 집합이 존재하지 않음
N개의 자연수의 중복을 허용하는 집합에서 S라는 모든 원소의 합을 값을 가지는 케이스 중에서 원소들의 곱이 최대가 되는 경우