Got Stuck in a Geometry Problem of CF

Правка en1, от mochow, 2015-07-02 11:17:33

Here is the problem: http://codeforces.me/problemset/problem/257/C

My approach was this: http://codeforces.me/contest/257/submission/11893523

I first sorted the points clockwise. Then from the last point of the 'clockwise-sorted' array, I go clockwise and counter-clockwise to calculate two angles: Angle1 and Angle2. These two values are actually the summation of the angle between two consecutive points. I output the minimum one.

Eventually, I found out that this problem can be solved in a lot shorter way but I cannot find a bug in my approach.

Was my approach correct? If no, then what did I do wrong? If yes, then how can I get rid of the error = '0.0000388'?

Теги computational geometry, geometry

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский mochow 2015-07-02 11:17:33 723 Initial revision (published)