-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[goormlevel] Title: 이진수 정렬, Time: 0.48 ms, Memory: 34.17 MB, Difficul…
…ty: 2 -BaekjoonHub
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# 이진수 정렬 - 195687/1 | ||
|
||
[문제 링크](https://level.goorm.io/exam/195687/%EC%9D%B4%EC%A7%84%EC%88%98-%EC%A0%95%EB%A0%AC/quiz/1) | ||
|
||
### 성능 요약 | ||
|
||
메모리: 34.17 MB, 시간: 0.48 ms | ||
|
||
### 제출 일자 | ||
|
||
2024년 07월 02일 12:39:41 | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# -*- coding: utf-8 -*- | ||
# UTF-8 encoding when using korean | ||
import sys | ||
input = sys.stdin.readline | ||
n, k= map(int, input().split()) | ||
lst = list(map(int, input().split())) | ||
|
||
def bi_cnt(a): | ||
return str(format(a,'b')).count('1') | ||
|
||
lst.sort(reverse=True, key=lambda x:(bi_cnt(x), x)) | ||
|
||
print(lst[k-1]) |