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

两处复杂度不准确 #92

Open
H-J-Granger opened this issue Oct 26, 2023 · 4 comments
Open

两处复杂度不准确 #92

H-J-Granger opened this issue Oct 26, 2023 · 4 comments

Comments

@H-J-Granger
Copy link

H-J-Granger commented Oct 26, 2023

在 0x31 的 Prime Distance 这题末尾提到,该题时间复杂度为 $O(\sqrt R\log\log\sqrt R+(R-L)\log\log R)$,这可化简为 $O((R-L)\log\log R)$

同一页的阶乘分解,这题末尾提到,该题对每个不超过 $n$ 的素数 $p$ 需要 $O(\log n)$ 的时间,那么复杂度应当为 $O(\pi(n)\log n)=O(n)$

@tabbbbbb
Copy link

tabbbbbb commented Oct 26, 2023 via email

@H-J-Granger H-J-Granger changed the title POJ 2689 Prime Distance 复杂度未化简 两处复杂度不准确 Oct 26, 2023
@XiongDiNanDang
Copy link

可是不一定存在 $\sqrt R\le R-L$,第一个化简不对吧。

@XiongDiNanDang
Copy link

第二个在新版已修正,建议 close 该 issue。

@H-J-Granger
Copy link
Author

可是不一定存在 R ≤ R − L ,第一个化简不对吧。

是的,第一个化简应为 $(\sqrt R+R-L)\log\log R$

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

3 participants