2026問AI之Tiobe程式語言排名與Py3, C, C++"你好"實作
herrDeng網內搜尋
自訂搜尋
Ads
2026年9月14日 星期一
2026年9月9日 星期三
2026年9月4日 星期五
0ms C++ Py3 |Suffix MIN與Prefix MAX解Leetcode 3903, 3904 Smallest Stable Index
0ms C++ Py3 Suffix MIN與Prefix MAX解Leetcode 3903, 3904 Smallest Stable Index
使用一個名為 suf 的陣列來記錄字尾最小值(suffix min)。
接著進行動態Prefix MAX(字首最大值)的計算,以找出何時滿足Max-suf[i] leq k!
[Py3 code請進]
2026年9月2日 星期三
0ms C++ 1-line Py3解Leetcode 3875, 3876 Construct Uniform Parity Array
0ms C++ 1-line Py3解Leetcode 3875, 3876 Construct Uniform Parity Array
一次解Leetcode 3875, 3876,code很簡單,重點是邏輯。
Solving LeetCode 3875 & 3876 together. Simple code, focus is on the logic.
[code on Leetcode 3875]https://leetcode.com/problems/construct-uniform-parity-array-i/solutions/8496231/1beats-100-by-anwendeng-o9jh/
2026年8月28日 星期五
0ms |C++貪婪mask dp解Leetcode難題3734 Lexico min Palindrome greater then target
0ms |C++貪婪mask dp解Leetcode難題3734 Lexico min Palindrome greater then target
這部影片詳細解析了 LeetCode 3734 難題。我們將結合「貪婪演算法 (Greedy)」與「位元遮罩動態規劃 (Bitmask DP)」技術,目標是找出比給定字串大、且字典序最小的回文字串。影片中展示了如何透過剪枝與狀態壓縮將效能優化至 0ms,達成最速解。適合想挑戰高難度演算法與 C++ 實作技巧的開發者。
2026年8月20日 星期四
0ms Branchless Leetcode 3069 | Py3 & C++ 高速解法
Py3 CPP 速解3069 Distribute Elements Into Two Arrays I
為什麼要寫branchless code?避免 CPU 的分支預測失敗!當代CPU 會預先猜測條件判斷(如 if-else)的結果並繼續往下執行。當預測成功時,猜對了效能極佳,猜錯了會造成時間上的懲罰。利用容器index的True or False達成Branchless code!
[C++ Python3 codes請進]
2026年8月15日 星期六
0ms C++ Py3 1 line 解 Leetcode 3702 sequence With Non Zero Bitwise XOR
0ms C++ Py3 1 line 解 Leetcode 3702 sequence With Non Zero Bitwise XOR
迴圈解不稀奇,Python一行解也不稀奇,C++一行解就很少了!
[C++ Py3 一行解請進 👇]
2026年8月12日 星期三
C++ Py3|Sliding window hashmap解Leetcode 2958 Length of Longest Subarray With at Most K
Beat 99.89% C++ Py3|Sliding window hashmap解Leetcode 2958 Length of Longest Subarray With at Most K
一陣子沒出Leetcode解題長片。這題其實很標準2958. Length of Longest Subarray With at Most K Frequency,適合練習sliding window+ hash map ! 客製化的hash map似乎是overkilling
2026年8月8日 星期六
2026年8月4日 星期二
Leetcode 3731 Missing Elements:試試 bitset 與1-line Python set,0ms 擊敗 100% 使用者
0ms CPP bitset Py3 1 liner set速解Leetcode 3731 Find Missing Elements
[Py3 一行解請進]
2026年7月27日 星期一
0ms 速解Leetcode 1464 最大的乘積:別只會用 Sort!試試Py nlargest, C++ nth_element
0ms|1 line Py3 #nlargest #cpp #nth_element 速解 #Leetcode1464 最大的乘積
Python 1行解用heapq.nlargest。C++2行解用nth_element,都是linear 0ms
[C++, Py3 codes請進]
2026年7月25日 星期六
黑柴遊二子坪 Gemini Omni, YOLOE 雙AI記事
黑柴 遊 二子坪 Gemini Omni, YOLOE 雙AI記事
GeminiOmni Flash產生動畫
#YOLOE #開放字彙 #零樣本 偵測
2026年7月19日 星期日
2026年7月2日 星期四
LeetCode 3286: 別只用 Dijkstra!0-1 BFS (deque) 才是 0ms 關鍵
0ms |C++ Py3| BFS使用deque解Leetcode 3286 Find a Safe Walk Through a Grid
了解以下幾點有助於解決最短路徑問題:
所有權重相同時,只需使用基於佇列queue的廣度優先搜尋(BFS over queue)
權重有兩種非負值(如本題所示),使用基於雙端佇列(deque)的廣度優先搜尋(BFS over deque)
權重為正值時,使用基於優先權佇列(priority queue)的廣度優先搜尋(類似Dijkstra演算法)
2026年7月1日 星期三
Beats 100%|C++ UnionFind BFS解Leetcode 2812 Find the Safest Path in a Grid
Beats 100%|C++ unionFind BFS linkedList解Leetcode 2812 Find the Safest Path in a Grid
本影片詳細講解如何結合 UnionFind與 BFS(廣度優先搜尋)來解決 LeetCode 2812. Find the Safest Path in a Grid。透過 BFS 預處理所有格子到最近小偷的距離,再利用 UnionFind 找出具有最大安全性係數的路徑,最終在 C++ 實作中達到 182ms 並擊敗 100% 的紀錄!
2026年6月27日 星期六
C++ bitset array依數字 3、13、177、31622分割解Leetcode 3020 Find the Maximum Number of Elements in Subset
C++ bitset array依數字 3、13、177、31622分割解Leetcode 3020 Find the Maximum Number of Elements in Subset
不用hashmap,另圖蹊徑才有辦法快速解答Leetcode 3020.
-----
No Hashmap—forging a new path to crush LeetCode 3020 fast.
Trick: isqrt(1e9)=31622 , 177, 13, 3
[codes on Leetcodes]https://leetcode.com/problems/find-the-maximum-number-of-elements-in-subset/solutions/8360422/divide-nums-according-to-3-1317731622bea-5tk4/
#anwendeng
2026年6月24日 星期三
Beats 100%|C/C++矩陣冪次方解Leetcode難題3700 Number of ZigZag Arrays II
Beats 100%|C/C++矩陣冪次方解Leetcode難題3700 Number of ZigZag Arrays II
[codes on Leetcode 3700]https://leetcode.com/problems/number-of-zigzag-arrays-ii/solutions/8354788/symmetrymatrix-exponential149ms-beats-10-9hxf/
[codes on Leetcode 3699]https://leetcode.com/problems/number-of-zigzag-arrays-i/solutions/8352758/use-symmetryprefixdpbeats-9352-by-anwend-xcjj/
在這段影片中,我將深入解析如何使用 矩陣快速冪 (Matrix Exponentiation) 來高效解決 LeetCode 難題 3700:Number of ZigZag Arrays II。這題是 ZigZag Array 系列的進階版本,對時間複雜度有極高要求。
2026年6月22日 星期一
0ms|Leetcode1189 text中可有幾個ballon|C++ 1 liner Py3
0ms|Leetcode1189 text中可有幾個ballon|C++ 1 linerPy3
會處理count freq,接著來就能處理counting sort
[Leetcode 1833 Maximum Ice Cream Bars|Greedy counting sort]https://www.youtube.com/watch?v=4deOmcdAekg
[codes on Leetcode]https://leetcode.com/problems/maximum-number-of-balloons/solutions/8350164/count-freqbeats-100-by-anwendeng-be0r/
[Py3 1-liner請進]
2026年6月21日 星期日
0ms C++ Py3|Leetcode 1833 Maximum Ice Cream Bars|Greedy counting sort
counting sort 0ms cpp py3 Leetcode1833
貪婪計數排序速解Leetcode 1833 Maximum Ice Cream Bars
2026年6月18日 星期四
LeetCode 1344 分針時針夾角:0ms 一行秒殺 (C++/Python)
0ms| 1-liner C++ Py3|1344. Angle Between Hands of a Clock
應徵程式設計師,也會問小學數學,不用懷疑。
-----
When applying for a programmer position, they'll ask you elementary school math questions, no doubt about it.
#leetcode #1liner #cplusplus #python #leetcode1344
[Py3 1-liner請進]
訂閱:
文章 (Atom)
熱門文章
-
明文=I'm student key=(2,15,8) 密文=?
-
請用C/C++ 程式計算 S=1*1+2*2+3*3+4*4+.....+20*20=?
-
C字串練習 字串 char word[]="You win!"; 輸出為: You win! You win You wi You w You You Yo Y 給進階使用者: gets () 是個危險的函式!
-
array ex 1, 2,3,7,8
-
請問如何用C/C++程式產生下列輸出? 1111111 2222222 3333333 4444444 5555555 6666666 7777777
-
統計第一作業 2, 3, 8, 9
-
列印課表數字代碼矩陣,以及代碼的課名 提示: 參考此連結