数位DP
文章平均质量分 94
memcpy0
希望探索文理结合的自由之路。
展开
-
LeetCode 600. Non-negative Integers without Consecutive Ones【数位DP,斐波那契,位运算】困难
Given a positive integer n, return the number of the integers in the range [0, n] whose binary representations do not contain consecutive ones. Example 1: Input: n = 5 Output: 5 Explanation: Here are the non-negative integers <= 5 with their correspondi原创 2021-06-14 02:15:38 · 229 阅读 · 0 评论 -
LeetCode 1012. Numbers With Repeated Digits【数位DP,数学】困难
本文属于「征服LeetCode」系列文章之一,这一系列正式开始于2021/08/12。由于LeetCode上部分题目有锁,本系列将至少持续到刷完所有无锁题之日为止;由于LeetCode还在不断地创建新题,本系列的终止日期可能是永远。在这一系列刷题文章中,我不仅会讲解多种解题思路及其优化,还会用多种编程语言实现题解,涉及到通用解法时更将归纳总结出相应的算法模板。。原创 2023-03-22 22:13:24 · 366 阅读 · 0 评论