Test 18

What the fucking test is it? I failed on it many times, using every possible precision in calculations!

Re: Test 18

I used Eps=1E-7 to compare two numbers and got Ac.

Re: Test 18

I used it too...

By the way, maybe my algo is wrong? I calculated the distances between i-th and (i+1)-th poitns and the distances between i-th and ((i+n/2) mod n)-th points if n is even or between i-th and a middle of segment, which is constructed by ((i+(n-1)/2) mod n)-th and ((i+(n+1)/2) mod n)-th points if n is odd. If these distances are equal, then "YES"

*Edited by author 17.04.2010 01:44*

Re: Test 18

maybe it is wrong!))

Re: Test 18

OK, what counter-test do you know then? :)

Re: Test 18

what will be your answer if the polygon is not convex??

Re: Test 18

Oh! You are right, my program outputs "YES" on some special tests, but the answer should be always "NO"! Thank you!

Now I've got AC. Simple algo with checking if points lie on a circumference and Point[i].x = x0 + R*cos(a0 + 2*k*PI/n), Point[i].y = y0 + R*sin(a0 + 2*k*PI/n) is true for sure.

I just wanted to implement my "exotic" algo there :))))

But it was wrong...

*Edited by author 18.04.2010 12:11*

Re: Test 18

Posted by

xt3000 25 Apr 2010 12:57

I used your algo,but always wa4 ,why?

Re: Test 18

Posted by

svr 24 Oct 2010 11:27

I think that most Ac are by the chance, varing eps.

If impossible to solve from the fist submission the problem is incorrect.

I think right uderstanding the problem is following:

Let P=<P1,...,Pn>-given n-polygon and

r(P)=min(max dist(Pi-Qi),on all ideal n-polygons Q=<Q1,...,Qn>)

if(r(P)<=1.e-5) YES else NO.

That is optimization problem.

P.S. I glad to say that under above consideration

I got AC immidiately,

while using chaotic eps-using had 12 WA 18.

*Edited by author 24.10.2010 12:41*