magical STL makes convex hull problems so easy to get accepted

conevex hull problems requires sorting the points in 2D in anticlockwise sense with the first point being the one with lowest y co-ord (x co-ord breaks the tie)
so this can be done by first sorting the points in order of y co-ord and then in order of polar angle by using apt comparison functions…
i solved 2 problems on spoj using it and it was a nice learning curve
heres my code :

c++11 complex container :

1 Like