Skip to content

Commit

Permalink
[goormlevel] Title: 이진수 정렬, Time: 0.48 ms, Memory: 34.17 MB, Difficul…
Browse files Browse the repository at this point in the history
…ty: 2 -BaekjoonHub
  • Loading branch information
boyamie committed Jul 2, 2024
1 parent 0588358 commit 0252e4b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
12 changes: 12 additions & 0 deletions goormlevel/195687/1. 이진수 정렬/README.md
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

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])

0 comments on commit 0252e4b

Please sign in to comment.