/* 自定義代碼塊樣式 */
Herr Deng桑的教學blog
這是Herr Deng桑的教學blog,主要處理作業與班導事務,另外還有數位小品。
網頁
首頁
密碼學
程式設計Programming
APP
計算機概論
herrDeng網內搜尋
自訂搜尋
Ads
2025年9月16日 星期二
C C++ GCD LCM解Leetcode難題2197 Replace Non Coprime Numbers in Array[含Py3 code]
C C++ GCD LCM解Leetcode難題2197 Replace Non Coprime Numbers in Array
用binary Euclidean algorithm定義gcd,然後定義lcm之後就是用stack
[Py3 code請進]
按我讀文 »
2025年9月14日 星期日
C++ Trie prefix tree解母音拼字Leetcode 966 Vowel Spellchecker
C++ Trie prefix tree解母音拼字Leetcode 966 Vowel Spellchecker
如果unordered_set, unordered_map有其他替方案就用,能用Trie去解也算是一種成就
--------
If there are alternatives to unordered_set and unordered_map, use them. Being able to solve them with Trie is also an achievement.
[codes on Leetcode]
https://leetcode.com/problems/vowel-spellchecker/solutions/7187402/vowel-bitmask-trie-vs-hash-tables-15ms-beats-100/
較新的文章
較舊的文章
首頁
訂閱:
意見 (Atom)
熱門文章
計算你上學期加權平均
計算你上學期加權平均
產生50個元素的陣列並排序
產生50個元素的陣列並排序
ex1
請用 C/C++/java寫一簡易程式
Caesar挪移碼
Caesar挪移碼密文: MCLGZ 請破譯!
計算你的BMI
計算你的BMI
作業4:複利計算
借錢500萬,年利18%,每月複利計算,請問連本帶利的金額 5, 10, 15, 20, 25, 30, 35, 40, 45, 50年的金額。並比較公式: A*exp(0.18n) A*(1+0.18/12)^(12*n), n=年數, A=本金 hint: math.h, p...
array
array ex 1, 2,3,7,8
利用static方法輸出BMI
利用static方法輸出BMI
3種金鑰?
Fibonacci Sequence(1)
Fibonacci sequence: a[0]=1, a[1]=1, a[2]=2, a[3]=3, a[4]=5,...... In general, a[n]=1 as n=0,1, a[n]=a[n-1]+a[n-2] as n>=2. Use this...