|
|
back to boardWhy WA on test #6? 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? Hm... I'm change QuickSort to Heapsort and get AC!!! |
|
|