Skip to content

[bus710] Week 14 #1097

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 16, 2025
Merged

[bus710] Week 14 #1097

merged 1 commit into from
Mar 16, 2025

Conversation

bus710
Copy link
Contributor

@bus710 bus710 commented Mar 11, 2025

답안 제출 문제

체크 리스트

  • 우측 메뉴에서 PR을 Projects에 추가해주세요.
  • Projects의 오른쪽 버튼(▼)을 눌러 확장한 뒤, Week를 현재 주차로 설정해주세요.
  • 바로 앞에 PR을 열어주신 분을 코드 검토자로 지정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 StatusIn Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

@bus710 bus710 requested a review from a team as a code owner March 11, 2025 22:29
@bus710 bus710 moved this from Solving to In Review in 리트코드 스터디 3기 Mar 11, 2025
@github-actions github-actions bot added the go label Mar 11, 2025
@bus710 bus710 requested a review from forest000014 March 11, 2025 22:30
@bus710
Copy link
Contributor Author

bus710 commented Mar 11, 2025

풀이 1

사실, 실수로 몇 주 전에 한번 풀었던 문제 입니다. 같은 디렉터리 안에 bus710.rs가 있습니다.
거의 동일한 방식으로 풀었음에도, 러스트 버전은 상위 5% 안에 드는 성능을 보여 주었는데, 고 버전은 하위 5%로 쭉 떨어지네요??? 아마도 내부적으로 오버헤드가 있나 봅니다.

공간적으로는, 주어진 숫자만큼의 배열을 만들고 순회하기 때문에 O(n)이겠지만,
시간적으로는, 생성한 바이너리 스트링 내의 "1"을 세느라 내부적으로 순회할 것이기 때문에 O(n log n)이 아닐까 싶습니다.

@SamTheKorean
Copy link
Contributor

같은 알고리즘인데 속도가 그렇게 차이 난다는 건 고가 속도 면에서 느린 편에 속하는 거일 수도 있겠군요ㅎㅎ 이번 주도 고생하셨습니다!

Copy link
Contributor

@SamTheKorean SamTheKorean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!ㅎㅎ

@SamTheKorean SamTheKorean merged commit 673403b into DaleStudy:main Mar 16, 2025
3 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Completed in 리트코드 스터디 3기 Mar 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

2 participants