Skip to content

已发布文章的代码错误 #577

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

Closed
1589864500 opened this issue Jan 12, 2023 · 7 comments
Closed

已发布文章的代码错误 #577

1589864500 opened this issue Jan 12, 2023 · 7 comments

Comments

@1589864500
Copy link

暂时不知道往哪提交issue, 先交到这, 作者有幸看到再折叠掉好了.
简单来说, 状态压缩DP教程中len() API实现中, 判断len()==N的方法应该是 picked == (1 << (maxChoosableInteger + 1)) - 2, 而不是 -1, 因为二进制表示中的第0位默认为0, 全程没有用过. 因此len()==N时, picked应该等于1....10, 而不是1...11.

状态压缩DP教程 暂时只看到这两个网址
https://github.com/azl397985856/leetcode/blob/master/problems/464.can-i-win.md

https://mp.weixin.qq.com/s?__biz=MzI4MzUxNjI3OA==&mid=2247486874&idx=1&sn=0f27ddd51ad5b92ef0ddcc4fb19a3f5e&chksm=eb88c183dcff4895209c4dc4d005e3bb143cc852805594b407dbf3f4718c60261f09c2849f70&token=1227596150&lang=zh_CN#rd

@cherie-wuyajun
Copy link

cherie-wuyajun commented Jan 12, 2023 via email

@lording
Copy link

lording commented Jan 12, 2023 via email

@1589864500
Copy link
Author

1589864500 commented Jan 12, 2023 via email

@fyyzkd
Copy link

fyyzkd commented Jan 12, 2023 via email

@xiaosisong
Copy link

xiaosisong commented Jan 12, 2023 via email

@peak-up-fsl
Copy link

peak-up-fsl commented Jan 12, 2023 via email

@azl397985856
Copy link
Owner

azl397985856 commented Jan 14, 2023

是的。 不过更具体地应该说: 在 464. 我能赢吗 这道题中应该 - 2, 因为最后一位没用到过。 其他题目大家要具体问题具体分析。

image

我更新一下 Github 文章 https://github.com/azl397985856/leetcode/blob/master/problems/464.can-i-win.md?rgh-link-date=2023-01-12T12%3A14%3A10Z 。 公众号由于平台限制,无法更新。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants