python code請進
herrDeng網內搜尋
自訂搜尋
Ads
2023年11月22日 星期三
2023年11月20日 星期一
C++ python 迴圈累加解Leetcode垃圾車問題2391 Minimum Amount of Time to Collect Gar...
C++ python 迴圈累加解Leetcode垃圾車問題2391 Minimum Amount of Time to Collect Garbage。Leetcode垃圾車的問題根本是閱讀測驗,
2023年11月19日 星期日
C++頻率分析解Leetcode 1887 Reduction Operations to Make the Array Elements Equal
C++頻率分析解Leetcode 1887 Reduction Operations to Make the Array Elements EqualLeetcode這個週末的兩題都能用frequency count,即所謂的counting sort來解題,如1887. Reduction Operations to Make the Array Elements Equal。因為是線性時間比起官方解答都要快,當然就100趴
2023年11月18日 星期六
2023年11月16日 星期四
2023年11月15日 星期三
2023年11月9日 星期四
C++ python高斯小學公式解Leetcode 1759 Count Number of Homogenous Substrings
C++ python高斯小學公式解Leetcode 1759 Count Number of Homogenous Substrings
高斯小學公式解1+2+...+n=n(n+1)/2 就 O(1)時間,不用它也行改用迴圈需時O(n)。解Leetcode 1759. Count Number of Homogenous Substrings也很好用,O(n)時間,O(1)空間,如果還要優化,就考慮平行化,這裡似乎有難度,空間就多用點。
2023年11月7日 星期二
C++ python prefix Sum與pyplot圖解打怪問題Leetcode 1921 Eliminate Maximum Numb...
C++ python prefix Sum與pyplot圖解打怪問題Leetcode 1921 Eliminate Maximum Number of Monsters
2023年11月6日 星期一
C++優先佇列priority queue解Leetcode 1845 Seat Reservation Manager
CPP優先佇列priority queue解Leetcode 1845 Seat Reservation Manager
訂閱:
文章 (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=?
-
計算你的BMI
-
計算你上學期加權平均
-
GCD(123456789,345634567)=?
-
算上學期加權平均
-
何謂演算法?並列出一無窮迴圈的範例!
-
55x+27y=gcd
-
問int怎麼存-689這個數字。 int用4個bytes。 答案請用16進位表達。

