/* 自定義代碼塊樣式 */

herrDeng網內搜尋

自訂搜尋

Ads

2026年6月12日 星期五

C++Binary Lifting 視覺化解說 Leetcode

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月8日 星期一

2026年6月6日 星期六

0ms C++ Py3 1-line prefix sum速解Leetcode 2574 Left and Right Sum Differences


0ms C++ Py3 1-line prefix sum速解Leetcode 2574  Left and Right Sum Differences
3 different solutions are given in this video.
標示easy也確實可用簡化的方式來解,如果解答不是線性解,就要加油囉。Key word:Prefix sum
[Py3 1-liner請進]
Related Posts Plugin for WordPress, Blogger...

熱門文章