Open DeMen100ns opened 1 month ago
Recently, i use the Convexhull.h to submit problem 2195 on CSES. It passed almost of tests, except one test:
Convexhull.h
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.
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
Recently, i use the
Convexhull.h
to submit problem 2195 on CSES. It passed almost of tests, except one test:the judge returned error:
Here is link of my implementation: Link
I have ran the test in local and it returned the correct answer.