herrDeng網內搜尋
自訂搜尋
Ads
2025年11月21日 星期五
2025年11月16日 星期日
C++用 -1 mask法達到branchless解Leetcode1513 Number of Substrings With Only 1...
C++用 -1 mask法達到branchless解Leetcode1513 Number of Substrings With Only 1s|Py3 1-liner
其實很容易,想練功,試試一行解,或是把if分岔拿掉
[C++無分岔解請進]
2025年11月14日 星期五
Py3 C++ 2D sweep解Leetcode 2536 Increment Submatrices by One
Py3 C++ 2D sweep解Leetcode 2536 Increment Submatrices by One
使用2D掃描,方法為line sweep的2D推廣,方便好用。
[Py3解請進]
2025年11月9日 星期日
C++ Py3 Euclidean Algorithm解Leetcode 2169 Count Operations to Obtain Zero
C++ Py3 Euclidean Algorithm解Leetcode 2169 Count Operations to Obtain Zero
[Py3一行解請進]
2025年11月8日 星期六
Py3 C++導出遞迴公式解難題Leetcode1611 Minimum One Bit Operations to Make Integer...
Py3 C++導出遞迴公式解難題Leetcode1611 Minimum One Bit Operations to Make Integers Zero從導出公式到寫出code,一次完成解Leetcode難題
[C++一行解請進]
2025年10月30日 星期四
C++ py3 C Rust速解Leetcode 1526 Minimum Number of Increments on Subarrays ...
C++ py3 C Rust adjacent difference與loop速解Leetcode 1526 Minimum Number of Increments on Subarrays to Form a Target Array
[Py3一行解請進]
2025年10月26日 星期日
python requests讀取台積電股票json資訊爬蟲練習
url="https://www.twse.com.tw/exchangeReport/STOCK_DAY?response=json&date=20220330&stockNo=2330"
2025年10月21日 星期二
py3 C++ Line sweep解Leetcode 3346 Maximum Frequency of an Element After ...
py3 cpp Line sweep解Leetcode 3346 Maximum Frequency of an Element After Performing Operations I
使用 line sweep不用排序,可得線性解
[Py3解請進]
2025年10月13日 星期一
Py3 C++計數bitmask與2 pointers速解Leetcode2273 Find Resultant Array After Re...
Py3 C++計數bitmask與2 pointers速解Leetcode2273 Find Resultant Array After Removing Anagrams
字串長度最長也只有10,四個bits一組,用bitmask解題
-----
The maximum length of a string is only 10, and four bits are grouped together. Use bitmask to solve the problem.
[Py3 code請進]
2025年10月8日 星期三
C++ Py3 計數排序與partial sum解Leetcode 2300 Successful Pairs of Spells and ...
C++ Py3 計數排序與partial sum解Leetcode 2300 Successful Pairs of Spells and Potions
Portions的極大值小於等於10萬是可進行記數排序的關鍵,既然可以採用記數排序,後面的二元搜尋也可以透過partial sum的手法加速。
[Py3 code請進]
訂閱:
文章 (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進位表達。