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

Runtime Error with Convexhull.h #271

Open
DeMen100ns opened this issue Oct 2, 2024 · 1 comment
Open

Runtime Error with Convexhull.h #271

DeMen100ns opened this issue Oct 2, 2024 · 1 comment

Comments

@DeMen100ns
Copy link

Recently, i use the Convexhull.h to submit problem 2195 on CSES. It passed almost of tests, except one test:

4
3 2
1 5
3 6
3 5

the judge returned error:

code: malloc.c:2617: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.

Here is link of my implementation: Link

I have ran the test in local and it returned the correct answer.

@bjorn-martinsson
Copy link
Contributor

I just took a quick glance, but you have clearly modified the code from ConvexHull.h.

h[t-2].cross(h[t-1], p) < 0

vs

h[t-2].cross(h[t-1], p) <= 0

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