We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
n * (n + 1) * (2n + 1) / 6
6n - 1
6n + 1
a[0] & a[1] & a[2]...
target
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Table of Contents
基础数学
n * (n + 1) * (2n + 1) / 6
6n - 1
或6n + 1
(n >= 1)组合数学
基础算法
尺取法
因为
a[0] & a[1] & a[2]...
的结果是单调不增的,所以可以使用尺取法求出与target
值相近的区间单调队列
动态规划
动态规划的优化
图论
树
使用差分DP来统计每个子树对应的信息。避免DFS中申请额外的空间。
解题思路
下界的缩小范围和操作次数是有限的。所以缩小下界来推测上界。
偷鸡摸狗
位运算相关
The text was updated successfully, but these errors were encountered: