Title: Vinjunho/feature/boj 2075 N번째큰수 by Rekalux · Pull Request #298 · molgorithm/molgorithm2 · GitHub
Open Graph Title: Vinjunho/feature/boj 2075 N번째큰수 by Rekalux · Pull Request #298 · molgorithm/molgorithm2
X Title: Vinjunho/feature/boj 2075 N번째큰수 by Rekalux · Pull Request #298 · molgorithm/molgorithm2
Description: 백준 2075 N번째 큰 수 문제 링크 1. 설계 로직 n^2개의 수 중에서 n번째의 수를 구하는 문제이다. n^2개의 데이터를 모두 관리할 필요가 없다 상위 n개만 관리하여 n번째 수를 뽑아내면 되겠다. 이분탐색을 통해 랭킹을 관리하면 더 효율적. (n^2)log(n) , 1<=n<=1500 2. 코드 import sys, bisect input = sys.stdin.readline n = int(input()) lank = [] # 상위 n개의 수만 관리할 list for _ in range(n): li = list(map(int, input().split())) # readline for i in range(n): bisect.insort(lank, -li[i]) # 크기순으로 정렬하며 삽입한다(bisect는 이분탐색활용하므로 O(log(n)) if len(lank) > n: # 상위 n번째 이 후의 수는 볼 이유 없으므로 삭제 lank.pop() # 리스트 맨 끝을 날리는 pop()함수는 O(1) print(-lank[-1]) # n번째 수를 출력 3. 후기 어제 우선순위큐와 이분탐색에 대해 공부하다 bisect라는 말도 안 되는 라이브러리를 알게되었다. 앞으로 이분탐색이 필요할 때 많이 써먹어야겠다. 파이썬 사기
Open Graph Description: 백준 2075 N번째 큰 수 문제 링크 1. 설계 로직 n^2개의 수 중에서 n번째의 수를 구하는 문제이다. n^2개의 데이터를 모두 관리할 필요가 없다 상위 n개만 관리하여 n번째 수를 뽑아내면 되겠다. 이분탐색을 통해 랭킹을 관리하면 더 효율적. (n^2)log(n) , 1<=n<=1500 2. 코드 import sys, bise...
X Description: 백준 2075 N번째 큰 수 문제 링크 1. 설계 로직 n^2개의 수 중에서 n번째의 수를 구하는 문제이다. n^2개의 데이터를 모두 관리할 필요가 없다 상위 n개만 관리하여 n번째 수를 뽑아내면 되겠다. 이분탐색을 통해 랭킹을 관리하면 더 효율적. (n^2)log(n) , 1<=n<=1500 2. 코드 import s...
Opengraph URL: https://github.com/molgorithm/molgorithm2/pull/298
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:acb0328b-1839-272e-b965-af2c722e5702 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9606:1BDD2D:36DE8A0:460E48B:6975E28E |
| html-safe-nonce | 7b692af6f43738fe09bd5517bbac2fd283dbcfd54d048e92047e6cf727bb8910 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjA2OjFCREQyRDozNkRFOEEwOjQ2MEU0OEI6Njk3NUUyOEUiLCJ2aXNpdG9yX2lkIjoiNzE0MTk1MjIyMDM2MTUxNTY2MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | cc8ed6c252fbcfbb427f928c16e611d77cfb51fe7038f3ef35c781f7c9100a96 |
| hovercard-subject-tag | pull_request:749975263 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/molgorithm/molgorithm2/pull/298/files |
| twitter:image | https://avatars.githubusercontent.com/u/55969968?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/55969968?s=400&v=4 |
| og:image:alt | 백준 2075 N번째 큰 수 문제 링크 1. 설계 로직 n^2개의 수 중에서 n번째의 수를 구하는 문제이다. n^2개의 데이터를 모두 관리할 필요가 없다 상위 n개만 관리하여 n번째 수를 뽑아내면 되겠다. 이분탐색을 통해 랭킹을 관리하면 더 효율적. (n^2)log(n) , 1<=n<=1500 2. 코드 import sys, bise... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2bce766e7450b03e00b2fc5badd417927ce33a860e78cda3e4ecb9bbd1374cc6 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/molgorithm/molgorithm2 git https://github.com/molgorithm/molgorithm2.git |
| octolytics-dimension-user_id | 73650690 |
| octolytics-dimension-user_login | molgorithm |
| octolytics-dimension-repository_id | 377555788 |
| octolytics-dimension-repository_nwo | molgorithm/molgorithm2 |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 377555788 |
| octolytics-dimension-repository_network_root_nwo | molgorithm/molgorithm2 |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | fcca2b8ef702b5f7f91427a6e920fa44446fe312 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width