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

herrDeng網內搜尋

自訂搜尋

Ads

2023年7月31日 星期一

C++動態規劃DP解Leetcode 712,1143 LCS問題



C++動態規劃DP解Leetcode 712,1143 LCS問題。利用計算公式minimumDeleteSum=asciiSum(s1)+asciiSum(s2)−2×asciiSum(LCS)
LCS(Longest common subsequence)之類的問題其實跟 DNA 序列的比對問題密切關聯。

2023年7月30日 星期日

#黑柴犬 游泳初體驗(black shiba swimming)

 
黑柴犬 游泳初體驗,狗天生就會游泳,沒人教也沒狗教,一下水就狗爬式一路游

2023年7月16日 星期日

DP動態規劃與bit遮罩C++解Leetcode 1125小而夠的團隊Smallest Sufficient Team




DP動態規劃與bit遮罩C++解Leetcode 1125小而夠的團隊Smallest Sufficient Team
這段程式碼使用動態規劃來找出擁有所有所需技能的最小足夠團隊。它使用二進位遮罩表示技能,並遍歷所有可能的團隊成員組合來找到最佳解。

2023年7月8日 星期六

Python/C++ Geedy演算完美切割解難題Leetcode 2551 Put Marbles in Bags


Geedy演算完美切割解難題Leetcode 2551 Put Marbles in Bags 要找到所有切割的最大和最小score,可以使用兩種方法:排序切割score(partition[i] = weights[i] + weights[i+1])或使用堆(C++ priority_queue)。一旦score排序或存儲在堆中,就可以輕鬆識別最大和最小score。

2023年7月5日 星期三

backtracking solves 8 queens by C++八后問題展示回遡解答


backtracking solves 8 queen by C++. Visualize the solving process by own C++/openCV program. Base on my C++ code solving Leetcode 51. N-Queens. There are exact 92 solutions for 8 queens. Some of them will be shown.
Related Posts Plugin for WordPress, Blogger...

熱門文章