/* 自定義代碼塊樣式 */
Herr Deng桑的教學blog
這是Herr Deng桑的教學blog,主要處理作業與班導事務,另外還有數位小品。
網頁
首頁
密碼學
程式設計Programming
APP
計算機概論
herrDeng網內搜尋
自訂搜尋
Ads
2026年2月21日 星期六
C++ Py3 bitmask速解Leetcode 762 Prime Number of Set Bits in Binary Representation
C++ Py3 bitmask速解Leetcode 762 Prime Number of Set Bits in Binary Representation
這段影片示範如何使用計數位元和位元遮罩(bit mask),用幾行程式碼解決這個問題。
-----
this video shows how to use count bits & bitmask to solve this question in few lines.
[codes on Leetcode]
https://leetcode.com/problems/prime-number-of-set-bits-in-binary-representation/solutions/7595294/c-bits-count-vs-pascal-trianglebeats-100-2r67/
2026年2月19日 星期四
Py3 C++迴圈與計數解Leetcode 696 Count Binary Substrings
Py3 C++迴圈與計數解Leetcode 696 Count Binary Substrings
Leetcode 696. Count Binary Substrings雖然標示為easy,也沒那麼trivial,花了一番功夫才解出branchless C++。而一般回圈解倒是不難,但須要思考一下
-----
Leetcode 696. Count Binary Substrings, though marked as easy, isn't exactly trivial; it took me some effort to solve it in branchless C++. Solving the general loop problem isn't difficult, but it needs thinking.
[codes on Leetcode]
https://leetcode.com/problems/count-binary-substrings/solutions/7590515/cout-the-successive-1s-0sbeats-100-by-an-7amm/
較新的文章
較舊的文章
首頁
查看行動版
訂閱:
意見 (Atom)
熱門文章
計算你上學期加權平均
計算你上學期加權平均
簡易程式2(平方和)
請用C/C++ 程式計算 S=1*1+2*2+3*3+4*4+.....+20*20=?
ex. SHA-256, SHA3-256, RIPEMD-160
請問"虛擬貨幣用的雜湊函數"的SHA-256, SHA3-256, RIPEMD-160的雜湊摘要值
輸出字串20次
輸出字串20次
輸出課表代碼矩陣
輸出課表代碼矩陣 Hint: 2-D array, double-for loop
用 while loop
用 while loop 算 s=3*3+4*4+....88*88
ex6 請簡易說明Bitmap, Sleep的使用方式
請簡易說明Bitmap, Sleep的使用方式 請參考 https://anwendeng.blogspot.com/2020/03/visual-studio-2019-cwindows-formbitmap.html https://anwendeng.blogsp...
產生 亂數
產生10個0~99的亂數存在a[10] 中
data structure 期中考乙
data structure 期中考乙
「全民資安素養自我評量」
教育部為提昇全民資安素養與電腦防護能力,本部於101年9月5日至11月5日舉辦「全民資安素養自我評量」活動,請在活動期間內踴躍上網檢測資訊安全素養認知程度,並有機會參與抽獎,詳情請參閱活動網站(網址: https://isafe.moe.edu.tw/event