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)
熱門文章
-
C++用 -1 mask法達到branchless解Leetcode1513 Number of Substrings With Only 1s|Py3 1-liner 其實很容易,想練功,試試一行解,或是把if分岔拿掉 [C++無分岔解請進]
-
請用C/C++ 程式計算 S=1*1+2*2+3*3+4*4+.....+20*20=?
-
計算你上學期加權平均
-
問int怎麼存-689這個數字。 int用4個bytes。 答案請用16進位表達。
-
計算你的BMI
-
何謂演算法?並列出一無窮迴圈的範例!
-
將費氏數列輸出至一long 陣列 其中f[0]=1, f[1]=2, f[n]=f[n-1]+f[n-2] (n>=2)
-
請問你所使的電腦,CPU的規格 Cache多大?其他硬體配置...... 另外, "INTEL® XEON PHI™ 處理器 7230F"的大致規格為?
-
算上學期加權平均
-
列印課表數字代碼矩陣,以及代碼的課名 提示: 參考此連結