Herr Deng桑的教學blog
這是Herr Deng桑的教學blog,主要處理作業與班導事務,另外還有數位小品。
網頁
(移至...)
首頁
密碼學
程式設計Programming
APP
計算機概論
▼
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。
使用一次遞迴 DFS 求 root=0 的樹中的距離和,計算每個節點 i 作為根的子樹中的節點數。
‹
›
首頁
查看網路版