LeetCode 233: Number of Digit One - Mathematical Approach
Problem Count total occurrences of digit 1 in all non-negative integers ≤ n. Exa
POJ 2287 Tian Ji Horse Racing: Greedy Algorithm Solution
Problem Statement Classic Tian Ji horse racing: given n horses per side (Kings h
NAND Flash Porting for U-Boot on OK6410: Timer and Configuration Modifications
Timer Driver Refactoring The OK6410 U-Boot NAND port requires updating the timer
Porting DM9000 Network Driver to U-Boot on OK6410 Board
Hardware Context The OK6410 board uses a DM9000 Ethernet controller, but the def
Linux I/O Redirection Explained: File Descriptors and Shell Redirection
File Descriptor Fundamentals Every Linux process starts with three open file des
C++ References: Comprehensive Guide with Examples
Understanding C++ References A reference in C++ is an alias for an existing vari
C++ Warning C4800: BOOL vs bool Differences and Solutions
Understanding C++ Warning C4800 When compiling C++ code with Microsoft Visual C+
C++ 多線程協同工作模式:生產者-消費者 + 任務分發 + 結果匯總完整實現
C++11 多線程協同工作模型:主線程分發、工作線程池處理、阻塞等待匯總 模擬場景:主線程持有大量獨立任務(如求和 1~1000),創建固定大小工作線程池,動態
NYOJ 46 最少乘法次數:二進制分解求快速冪乘法數
NYOJ 46:計算 x^n 所需最少乘法次數——二進制位數法 僅允許乘法運算(a*b),求計算 x^n 的最少乘法次數。 結論:最少次數 = 最高位位置(0-
ZOJ 1041 Transmitters:半圓覆蓋最大點數幾何題
ZOJ 1041 Transmitters:可旋轉半圓覆蓋平面上最多點數 發射器位於 1000×1000 网格內任意位置,發射半徑 r 的半圓信號。可任意旋轉半
LeetCode 50 Pow(x, n):快速冪遞歸與迭代雙版本實現
LeetCode 50 Pow(x, n):O(log n) 快速冪完整解析 實現 double myPow(double x, int n),計算 x^n。n
華為 OJ 猴子分桃:數學規律推導與閉式公式 O(1) 解法
猴子分桃問題:從遞推到閉式公式 5^n - 4 與 n + 4^{n-1}·5^{n-1} - 4 n 只猴子依次分桃:每只將桃分成 5 堆、多 1 個給老猴、
POJ 2155 Matrix:二維樹狀數組區間修改單點查詢
POJ 2155 Matrix:二維樹狀數組區間修改單點查詢 POJ 2155「Matrix」要求支援矩陣區間翻轉(0↔1)與單點查詢。二維樹狀數組(2D BI
BZOJ 4174 tty 的求助:莫比烏斯反演求三重求和
BZOJ 4174:莫比烏斯反演優化 ∑∑∑ ⌊(nk+x)/m⌋ 至 O(n log n) 求 S = ∑_{n=1}^N ∑_{m=1}^M ∑_{k=0}
LeetCode 103 二叉樹鋸齒層序遍歷:雙端隊列/雙棧/標誌位多種實現
LeetCode 103 二叉樹鋸齒層序遍歷:雙端隊列/雙棧/標誌位多種實現 LeetCode 103「Binary Tree Zigzag Level Ord
LeetCode 36 有效數獨:行列宮三維驗證完整解法
LeetCode 36 有效數獨:行列宮三維驗證完整解法 LeetCode 36「Valid Sudoku」要求驗證 9×9 數獨盤面是否有效:每行、每列、每個
POJ 1012 Joseph 變體:好人壞人循環淘汰最小步長
POJ 1012 Joseph 變體:好人壞人循環淘汰最小步長 POJ 1012 是經典約瑟夫問題變體:2k 個人圍成圈,前 k 個是好人,後 k 個是壞人。每
ZOJ 1047 圖像周長:連通分量邊界長度計算
ZOJ 1047 圖像周長:連通分量邊界長度計算 ZOJ 1047「Image Perimeters」給定由 . 和 X 組成的網格,點擊某個 X 選中其所在的