카운팅소트
![[C++] 백준 10989번 수 정렬하기 3](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdGGjqp%2Fbtq96D22sPX%2FM30awOQy23Cus2mvyY8tl0%2Fimg.png)
[C++] 백준 10989번 수 정렬하기 3
문제에서 입력받는 수의 개수가 1000만개이다. 메모리 제한이 8MB이고, int 자료형이 4byte이므로 모든 수를 저장했을 때 40MB가 돼서 메모리 초과가 난다. 문제 끝에 수가 10,000보다 작거나 같은 자연수라는 조건을 잘 확인했으면 카운팅 소트를 시도해 봤을 것 같다. 뭔가 고민을 많이 안하고 그냥 sort, priority_queue를 사용해서 풀려고 시도하다가 많이 틀렸다. 구현 자체는 크게 어려운 게 없다. 카운팅 소트는 입력을 받으면서 sort하는 알고리즘이다. GitHub - kimyunseok/study-record: my study-record my study-record. Contribute to kimyunseok/study-record development by creati..