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

2022-10-6总结 | Ptilopsis_w's little blog #40

Open
Ptilopsisw opened this issue Oct 9, 2022 · 0 comments
Open

2022-10-6总结 | Ptilopsis_w's little blog #40

Ptilopsisw opened this issue Oct 9, 2022 · 0 comments

Comments

@Ptilopsisw
Copy link
Owner

https://ptilopsisw.github.io/2022/10/08/2022-10-6%E6%80%BB%E7%BB%93/

squence 考虑静态版本的做法。 只考虑一种单峰,另一种是一样的。 交换次数是对应原数组下标的逆序对个数。 从小到大排序后从两边向中间加数,可以放前面或后面。 贡献是对中间还没有加入的数的逆序对个数,也就是没放的数中 下标比它大的 比 下标比它小的 更多就放前面,否则放后面。 插入一个数,考虑它的影响。 它的下标一定是最大的,肯定放后面,本身不产生贡献。 但在它前面加入且放后面的数贡献+1,且

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

No branches or pull requests

1 participant