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/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:b80ccafa-c56a-f93f-a645-c9e28f647a16 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | B494:1C7DFD:6B4D576:8AA5C2B:69758B61 |
| html-safe-nonce | 917dbca0abb9e67f57b40bef07bc55811cced97e9b074a31f3ebfce506eb9fc5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDk0OjFDN0RGRDo2QjRENTc2OjhBQTVDMkI6Njk3NThCNjEiLCJ2aXNpdG9yX2lkIjoiMzk0Nzk2NTc3ODg0NTA3NjMyMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | becba701d45d111344e75ff6b53604e1f0d03e45828e60954215895037f05a03 |
| hovercard-subject-tag | pull_request:749975263 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/checks |
| 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 | 4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f |
| turbo-cache-control | no-preview |
| 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 full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 488b30e96dfd057fbbe44c6665ccbc030b729dde |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width