Help, Can't understand why this approach is giving WA

Правка en1, от Ferrarixxx, 2020-05-29 11:48:11

Hi Guys,
The above picture shows my approach for this problem https://codeforces.net/contest/1354/problem/C1

Am basically using the interior angle subtended by 3 adjacent vertices and then to find the vertical ( perpendicular ) line's length using tan function
But am getting completely unexpected answer.

// -- MY CODE :


long double n;

cin >> n;

// long double angle = (((180 * (2*n — 2)) / (2*n) ) / 360) * 2 * 3.14

long double angle = ((((n — 1)) / n)) * 3.14;

cout << tan(angle) << endl;


PLEASE GUYS HELP ME FIND MY MISTAKE .
THANKS IN ADVANCE.

Теги #help, #general, #problem c, #easy

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Ferrarixxx 2020-05-29 11:48:11 918 Initial revision (published)