/* 自定義代碼塊樣式 */
Herr Deng桑的教學blog
這是Herr Deng桑的教學blog,主要處理作業與班導事務,另外還有數位小品。
網頁
首頁
密碼學
程式設計Programming
APP
計算機概論
herrDeng網內搜尋
自訂搜尋
Ads
2024年11月2日 星期六
Colab上安裝中文字型修改股市爬蟲pyplot顯圖
Colab上安裝中文字型修改股市爬蟲pyplot顯圖
使用python套件:
numpy, requests. pyplot, matplotlib.font_manager, matplotlib.mpl
黑柴犬康芮颱風後行走
Python C++使用字串find迴圈速解Leetcode 2490 Circular Sentence
Python C++使用字串find迴圈速解Leetcode 2490 Circular Sentence
C++ & Python都有字串的find,用法都類似
split=s.find(' ', split+1)能找到s從index=split+1開始出現' '的第一個的index
[Python解請進, C++ 一行解]
按我讀文 »
2024年10月22日 星期二
C++ Python DFS與nth element( nlargest)Leetcode 2583 Kth Largest Sum in a...
Python C++ DFS與nth element nlargest解Leetcode 2583 Kth Largest Sum in a Binary Tree
用容器一次就配置大一點,寧可大一點不要不夠,解答的Code才會夠快。 解答快速程式簡單。
[Python解答請進]
----------
按我讀文 »
2024年10月14日 星期一
Python C++ heap priority queue速解L eetcode 2530 Maximal Score After Appl...
Python CPP heap priority queue速解L eetcode 2530. Maximal Score After Applying K Operations
heap/priority queue是重要的資料結構,無論是C++的std::priority_queue或是python的heapq都可以拿來練習這題用貪婪演算可解的問題
----------
Python解請進
按我讀文 »
2024年10月4日 星期五
貪婪計數Python C++解Leetcode 2491 Divide Players Into Teams of Equal Skill
貪婪計數Python C++解Leetcode 2491 Divide Players Into Teams of Equal Skill
貪婪演算+counting sort加上2-pointer這樣就完成打敗100趴的快速C++解答[Python code請進]
-----
按我讀文 »
2024年9月19日 星期四
C++採Catalan數的遞迴DP方式計算Leetcode 241 Different Ways to Add Parentheses
C++採Catalan數的遞迴DP方式計算Leetcode 241 Different Ways to Add Parentheses
每個數字都是葉節點,而+、-、*操作則不是。算術公式的 dfs 走訪等價於其對應的帶括號的 inOrder 算式。
-----
按我讀文 »
2024年9月15日 星期日
Python C++ bitmask解Leetcode 1371 Find the Longest Substring Containing ...
Python C++ bitmask解Leetcode 1371 Find the Longest Substring Containing Vowels in Even Counts
建構一個容器first_seen[32](5個母音考慮2**5=32),它表示第一次看到的32不同bmask的索引
[Python code請進]
-----
按我讀文 »
2024年9月5日 星期四
python C++速解Leetcode算術題2028 Find Missing Observations
python C++速解Leetcode算術題2028 Find Missing Observations
[Python code請進]
按我讀文 »
2024年9月3日 星期二
python C++速解Leetcode 1945 Sum of Digits of String After Convert
python C++速解Leetcode 1945 Sum of Digits of String After Convert
這是個簡單問題,有技巧。
第一次轉換不需要用bigINT來存,只是將數字與第1輪的數字相加即可。
由於s.length最多可能為100,因此使用bigInt或其他字串效率非常低。
[Python code請進]
---
按我讀文 »
較新的文章
較舊的文章
首頁
訂閱:
文章 (Atom)
熱門文章
計算你上學期加權平均
計算你上學期加權平均
「全民資安素養自我評量」
教育部為提昇全民資安素養與電腦防護能力,本部於101年9月5日至11月5日舉辦「全民資安素養自我評量」活動,請在活動期間內踴躍上網檢測資訊安全素養認知程度,並有機會參與抽獎,詳情請參閱活動網站(網址: https://isafe.moe.edu.tw/event
河內塔程式
河內塔程式
費氏數列
將費氏數列輸出至一long 陣列 其中f[0]=1, f[1]=2, f[n]=f[n-1]+f[n-2] (n>=2)
算上學期加權平均
算上學期加權平均
資料結構統計
LinkedList Exercise mm/dd Java 中的 LinkedList mm/dd 列印課表 mm/dd GCD mm/dd Ex2 mm/dd 用Eclipse寫hello.java mm/dd
簡答題
簡答題: 比較C/C++, Java, VB的差異!
何謂演算法
何謂演算法?並列出一無窮迴圈的範例!
猜數字
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...