herrDeng網內搜尋
自訂搜尋
Ads
2026年6月12日 星期五
Beats 100%|C++ BFS LCA binary lifting與模指數運算解Leetcode難題3559 Number of Ways to Assign Edge Weights II
#anwendeng
Beats 100%|C++ BFS LCA binary lfting與模指數運算解Leetcode難題3559 Number of Ways to Assign Edge Weights II
- Adjacency-list: array linked Lists
- BFS - construct parent[], level[]
- LCA- binary lifting - distance
- Fast modular power , pow2
- query call distance & pow2 to give answer
2026年6月11日 星期四
C++實作快速模指數運算LeetCode、Competitive Programming
#cplusplus 實作快速模指數運算
許多刷題如#Leetcode 需要有實作#快速模指數 運算的#modular #exponentiation 技能 #binary method
計算 x**N (mod P)用for迴圈跑N次其實是很慢!特別N很大
2026年6月10日 星期三
2026年6月9日 星期二
LeetCode 3689 | 0ms C++ minmax & Python 1-Liner
C++ #minmax 0ms Py #1liner 速解Leetcode 3689 Maximum Total Subarray Value I
2026年6月8日 星期一
0ms branchless|C++ Py3 2-pointer速解Leetcode 2161 Partition Array According to Given Pivot
C++ Py3 2pointer速解Leetcode2161 Partition Array According to Given Pivot
影片說明解法Py3用迴圈 list 相加。
[C++branchless 0ms請進]
訂閱:
文章 (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)=?
-
明文=I'm student key=(2,15,8) 密文=?
-
C字串練習 字串 char word[]="You win!"; 輸出為: You win! You win You wi You w You You Yo Y 給進階使用者: gets () 是個危險的函式!
-
請輸出如下 * ** *** **** ***** ******