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

Point query code is incorrect. #1266

Open
shankyty opened this issue Apr 18, 2024 · 1 comment
Open

Point query code is incorrect. #1266

shankyty opened this issue Apr 18, 2024 · 1 comment

Comments

@shankyty
Copy link

In section logic for point query is same as range query

int point_query(int idx) {
    int ret = 0;
    for (++idx; idx > 0; idx -= idx & -idx)
        ret += bit[idx];
    return ret;
}
@mhayter
Copy link
Contributor

mhayter commented Apr 18, 2024

How is it incorrect? Have you tested it?

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

2 participants