ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1207. Median on the Plane

Why WA on test #6?
Posted by NIS (liceum 165) 10 Aug 2006 18:15
I am use __int64 and sorting points:
inline short polarCmp(int a,int b)
{
    __int64 x1 = __int64(p[a].x)-p[0].x;
    __int64 y1 = __int64(p[a].y)-p[0].y;
    __int64 x2 = __int64(p[b].x)-p[a].x;
    __int64 y2 = __int64(p[b].y)-p[a].y;
    __int64 vp = x1*y2-x2*y1;
    return (vp<0)?-1:(vp==0)?0:1;
}
p[0] - most down left point

Edited by author 12.08.2006 13:00
Re: Why WA on test #6?
Posted by Nizovtsev Sergey (Lyceum #165) 18 Oct 2006 15:56
Hm... I'm change QuickSort to Heapsort and get AC!!!