Skip to content
New issue

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

Add 枚举子集 / 子集的子集 #5097

Closed
Hszzzx opened this issue Aug 20, 2023 · 2 comments · Fixed by #5266
Closed

Add 枚举子集 / 子集的子集 #5097

Hszzzx opened this issue Aug 20, 2023 · 2 comments · Fixed by #5266
Labels
Content Request / 内容请求 New feature or request

Comments

@Hszzzx
Copy link
Contributor

Hszzzx commented Aug 20, 2023

页面英文名

No response

我希望能添加的内容是

建议添加到 状压 DP 页面。
例题:洛谷 P5911

我了解到的相关参考资料有

暴力枚举集合并判断是否是其子集是 O(4^n) 的,但总共的子集只有 3^n
个(可用二项式定理证明)。

O(3^n) 代码如下:

for (int i = 1; i < (1 << n); ++i)
    for (int j = i; j; j = (j - 1) & i) 
        // Do something...
@Hszzzx Hszzzx added the Content Request / 内容请求 New feature or request label Aug 20, 2023
@welcome
Copy link

welcome bot commented Aug 20, 2023

感谢你对 OI Wiki 的关注!记得在 Issue 中表达清楚自己的意思哦~

@Great-designer
Copy link
Contributor

重复 #4991

另外这俩都已经写了,要么调整文章结构,要么可能是非必要的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content Request / 内容请求 New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants