Herr Deng桑的教學blog
這是Herr Deng桑的教學blog,主要處理作業與班導事務,另外還有數位小品。
網頁
(移至...)
首頁
密碼學
程式設計Programming
APP
計算機概論
▼
2025年6月28日 星期六
Py3排序 C++nth_element速解Leetcode 2099 Find Subsequence of Length K With t...
Py3排序 C++nth_element速解Leetcode 2099 Find Subsequence of Length K With the Largest Sum
C++的nth_element很好用,基本上是做partition,在這個問題可取代sort
----
C++'s nth_element is very useful. It basically does partitioning and can replace sort in this problem.
[codes on Leetcode]
https://leetcode.com/problems/find-subsequence-of-length-k-with-the-largest-sum/solutions/6893606/nth-element-counting-sort-c-100-py3-1-line/
‹
›
首頁
查看網路版