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 1729. Dead Man's Chest

WA 5
Posted by Roland 18 Oct 2009 00:41
What is wrong?
My answer is:
ans=((int)(360/(2*a)-1))*2*r*sin((a*pi)/180)+r
I HAVE THE SAME PROBLEM PLEASE HELP US....
Posted by fuch_prog_er 24 Oct 2009 01:26
I HAVE THE SAME PROBLEM PLEASE HELP US....

My program is :

#include<iostream>
#include<cmath>
#define PI 3.14159265358979323846264338327950288
using namespace std;
double r,a,whole,reminder,side,leftSide;
int main()
{
   cin>>r>>a;
   whole=180/a;
   reminder=360-whole*(2.0*a);
   side=2*r*sin(a*PI/180);
   leftSide=2*r*sin(reminder*PI/360.0);
   printf("%.12lf",r+(whole-1)*side+leftSide);
   system("pause");
   return 0;
}
Re: WA 5
Posted by Ras Misha [t4ce] 25 Oct 2009 16:42
you forget about last part

for ex input 1 40

you have 3 part with arch = 80 degrees

and last 40 degrees (not 80)

SOrry for my english
I hope that you understand
Re: WA 5
Posted by Fyodor Menshikov 1 Dec 2009 00:17
Test 5:
Input 10.000 30.001
Output 59.999698