week2 2751 수 정렬하기 김다운 #40
Open
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.
정직하게 정렬했다. 다만 입력값이 최대 100만 개였기에 최대한 시간복잡도가 log(n)과 비슷한 정도의 방식이 필요했다는 것은 감을 잡을 수 있었다. 어떤 정렬이 그에 맞는지 찾고 빠르게 코드를 작성할 수 있는지가 중요한데, 운 좋게도 이 문제는
sys라이브러리의sys.stdin.readline()을 사용해서 통과할 수 있었다.(참고로
int로 변환할 때엔rstrip()을 사용할 필요가 없다고 해서 뺐다.)다른 정렬 방식들을 사용한 풀이들이 궁금해서 찾아봤는데, 병합 정렬의 경우 주어진 예제로는
time라이브러리를 이용하여 시간을 재본 결과 되려 더 느렸기 때문에(게다가 소요시간도 3초대로sys라이브러리를 사용하지 않았을 때와 비등비등했다), 각 정렬들의 결과물을 대충 예상하기 어렵다는 점이 막막한 것 같다.코딩테스트를 할 땐 직접 여러 정렬을 구현하면서고 많은 양의 input을 직접 넣어서 시간을 잴 환경이 아니므로, 역시 평소 문제를 많이 풀어보면서 시간복잡도를 계산하는 감을 길러야 될 것이다.