herrDeng網內搜尋
自訂搜尋
Ads
2026年10月2日 星期五
2026年10月1日 星期四
2026年9月30日 星期三
2026年9月24日 星期四
2026年9月23日 星期三
2026年9月14日 星期一
2026年9月9日 星期三
2026年9月4日 星期五
0ms C++ Py3 |Suffix MIN與Prefix MAX解Leetcode 3903, 3904 Smallest Stable Index
0ms C++ Py3 Suffix MIN與Prefix MAX解Leetcode 3903, 3904 Smallest Stable Index
使用一個名為 suf 的陣列來記錄字尾最小值(suffix min)。
接著進行動態Prefix MAX(字首最大值)的計算,以找出何時滿足Max-suf[i] leq k!
[Py3 code請進]
2026年9月2日 星期三
0ms C++ 1-line Py3解Leetcode 3875, 3876 Construct Uniform Parity Array
0ms C++ 1-line Py3解Leetcode 3875, 3876 Construct Uniform Parity Array
一次解Leetcode 3875, 3876,code很簡單,重點是邏輯。
Solving LeetCode 3875 & 3876 together. Simple code, focus is on the logic.
[code on Leetcode 3875]https://leetcode.com/problems/construct-uniform-parity-array-i/solutions/8496231/1beats-100-by-anwendeng-o9jh/
2026年8月28日 星期五
0ms |C++貪婪mask dp解Leetcode難題3734 Lexico min Palindrome greater then target
0ms |C++貪婪mask dp解Leetcode難題3734 Lexico min Palindrome greater then target
這部影片詳細解析了 LeetCode 3734 難題。我們將結合「貪婪演算法 (Greedy)」與「位元遮罩動態規劃 (Bitmask DP)」技術,目標是找出比給定字串大、且字典序最小的回文字串。影片中展示了如何透過剪枝與狀態壓縮將效能優化至 0ms,達成最速解。適合想挑戰高難度演算法與 C++ 實作技巧的開發者。
訂閱:
文章 (Atom)
熱門文章
-
array ex 1, 2,3,7,8
-
統計第一作業 2, 3, 8, 9
-
請問如何用C/C++程式產生下列輸出? 1111111 2222222 3333333 4444444 5555555 6666666 7777777
-
請用CPU-Z軟體檢測Cache & Memory 註:快取(L1-L3: SRAM) 第一級快取(L1)–通常存取只需要幾個週期,通常是幾十個KB。 第二級快取(L2)–比L1約有2到10倍較高延遲性,通常是幾百個KB或更多。 第三級快取(L3)(不...
-
GCD(123456789,345634567)=?
-
C字串練習 字串 char word[]="You win!"; 輸出為: You win! You win You wi You w You You Yo Y 給進階使用者: gets () 是個危險的函式!
-
明文=I'm student key=(2,15,8) 密文=?
-
算上學期加權平均
-
請輸出如下 * ** *** **** ***** ******