Herr Deng桑的教學blog
這是Herr Deng桑的教學blog,主要處理作業與班導事務,另外還有數位小品。
網頁
(移至...)
首頁
密碼學
程式設計Programming
APP
計算機概論
▼
2024年5月26日 星期日
python C++ DP動態規劃速解難題Leetcode 552 Student Attendance Record II
›
python CPP DP動態規劃速解難題Leetcode 552 Student Attendance Record II Leetcode 552. Student Attendance Record II為什麼是難題?原來@cache這招會導致MLE。先用動態規劃解...
2024年5月25日 星期六
C++DP動態規劃Trie解Leetcode 難題140 wordbreak 2
›
DP動態規劃Trie解Leetcode 難題140 wordbreak 2 解Leetcode難題140. Word Break II 用DP+ Trie這樣解,應該算是難題 -----
2024年5月21日 星期二
Python C++ 回遡bit mask解Leetcode 78, 90 subsets 1, 2
›
Python C++ 回遡bit mask解Leetcode 78, 90 subsets 1, 2 Subset/Powerset question. 2 approaches :bit mask & backtracking Python 請進
2024年5月18日 星期六
C++ python後序走訪解Leetcode 979 Distribute Coins in Binary Tree
›
C++ python後序走訪解Leetcode 979 Distribute Coins in Binary Tree 解Leetcode 979. Distribute Coins in Binary Tree。學過二元樹的一定會使用post-order走訪,重點不是codi...
2024年5月12日 星期日
python C++速解MaxPooling Leetcode 2373 Largest Local Values in a Matrix
›
python CPP速解MaxPooling Leetcode 2373 Largest Local Values in a Matrix 算maxPooling stride=1就一般矩陣計算而已,找出子矩陣的極大,可以只使用額外空間O(1)就得解。C++解請進。 -----
2024年5月4日 星期六
C++ python貪婪排序2 pointer解Leetcode 881 Boats to Save People
›
C++ python貪婪排序2 pointer解Leetcode 881 Boats to Save People Greedy是這類問題的關鍵,片中先用sort, counting sort來排序,左有兩游標大小一對看能不能一次載兩人,逐次移動游標 -------
2024年5月1日 星期三
如何將teachable Machine訓練好的模型在Google colab執行python opencv程式
›
如何將teachable Machine訓練好的模型在Google colab執行python opencv程式
2024年4月29日 星期一
C++/reroot DP動態規劃解Leetcode難題834 Sum of Distances in Tree
›
C++/reroot DP動態規劃解Leetcode難題834 Sum of Distances in Tree 關鍵字:reroot DP。 你會發現很多關於它的討論。 對於作為根的每個節點,進行 DFS,將獲得 O(n^2) 的解決方案,但可能 TLE。 使用一次遞迴 DF...
2024年4月24日 星期三
C++ UnionFind BFS DFS解圖論問題Leetcode 1971 Find if Path Exists in Graph
›
C++ UnionFind BFS DFS解圖論問題Leetcode 1971 Find if Path Exists in Graph 使用UnionFind class實作容易,效能又好,這對無向圖特別有效。 為了比較,BFS、DFS也實作
Python C++速解Leetcode 1137 N th Tribonacci Number
›
Python CPP速解Leetcode 1137 N th Tribonacci Number 先用遞迴、再加上cache,然後轉成動態規劃,當然還可以用矩陣冪次方
‹
›
首頁
查看網路版