Digit-Dp
LeetCode 2376: Count Special Integers
·1 分鐘
LeetCode
Hard
Dynamic-Programming
Digit-Dp
Math
Bitmask
LeetCode 2376 解題筆記:數位 DP,狀態 (pos, tight, started, mask);mask 記錄用過的數字,前導零不能算成用過 0
LeetCode 902: Numbers At Most N Given Digit Set
·1 分鐘
LeetCode
Hard
Dynamic-Programming
Digit-Dp
Math
Binary-Search
String
LeetCode 902 解題筆記:數位 DP,狀態是 (pos, tight, started);還沒開始時可以跳過這一位,代表位數比 n 少的數
LeetCode 3906: Count Good Integers on a Grid Path
·2 分鐘
LeetCode
Hard
Dynamic-Programming
Digit-Dp
LeetCode 3906 解題筆記:範圍到 9 × 10^15,不能逐一檢查;數位 DP 同時帶上下界兩個 tight,路徑上的格子要非遞減,狀態多記「路徑上前一個數字」
LeetCode 2999: Count the Number of Powerful Integers
·1 分鐘
LeetCode
Daily
Hard
Digit-Dp
LeetCode 解題紀錄
LeetCode 2843: Count Symmetric Integers
·1 分鐘
LeetCode
Daily
Easy
Digit-Dp
LeetCode 解題紀錄
Digit Dynamic Programming
·3 分鐘
演算法
Digit-Dp
Digit Dynamic Programming 介紹