8000 [23-02-01] hyuksoon.py by chs98412 · Pull Request #40 · da-in/algorithm-study · GitHub
[go: up one dir, main page]

Skip to content

[23-02-01] hyuksoon.py #40

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 3 commits into from
Feb 1, 2023
Merged

[23-02-01] hyuksoon.py #40

merged 3 commits into from
Feb 1, 2023

Conversation

chs98412
Copy link
Collaborator

PR Summary

  • K번째 수
    그냥 매번 했는데 매번 소트 안하는 법은 없나요? 갈켜주실 분?

  • 가장 큰 수
    갱장히 스트레스 받고 풀었습니다...
    343, 34 중에는 34가 먼저 나와야 하고
    323, 32 중에는 323이 먼저 나와야 하길래
    울까 하다가
    1,2,3,,,1,2,3,,중얼중얼 하다가 갑자기 초등학교때 배운 최소공배수가 떠올랐습니다.
    1000이하니깐 세자리까지만 등장하잖아요?
    그래서 모든 숫자를 6자리로 바꾸었습니다.
    3-> 333333
    34-> 343434
    343 -> 343343
    그렇게 해서 정렬하니깐 풀리더라구요
    굉장히 야매스럽습니다
    조건이 1000 넘어가면 이 방법은 안먹히고
    0과 1000은 처리하지 못해서 따로 처리해줬습니다 ㅋ.ㅋ
    문제 맛있네요

  • 더 맵게
    힙으로 풀긴 했는데 항상 길이가 2이상이어야 하잖아요
    근데 매번 길이를 구하자니 배열길이가 최대 100만이라 부담될거 같아서
    그냥 try-except 써버렸는데 이거의 시간복잡도는 모르겠습니다?

ISSUE NUMBER


data.append([i+i*((6-len(i))//len(i)),len(i)])

data.sort(key = lambda x : (-int(x[0]) ))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

사실 람다가 필요없어요

@chs98412 chs98412 merged commit 422ede3 into da-in:main Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0