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 1020. Rope

It accepted!
Posted by Jumbo 21 Mar 2011 22:35
type t=record
     x,y:real;
     end;

function dlina(x1,y1,x2,y2:real): real;
begin
 dlina:=sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) );
end;


var n,i:integer; x,y,p,cos,r:real; mas:array[1..103] of t;
Begin
readln(n,r);
p:=0;
for i:=1 to n do begin
  readln(mas[i].x,mas[i].y);
  if i>1 then p:=p+dlina(mas[i-1].x,mas[i-1].y,mas[i].x,mas[i].y);
end;
p:=p+dlina(mas[1].x,mas[1].y,mas[n].x,mas[n].y);



p:=p+2*3.14159*r;
writeln(p:1:2);

end.
Re: It accepted!
Posted by Alexander J. Villalba G. 12 Apr 2011 07:46
jajaja

good!

I don't know this: 2*3.14159*r

saves a lot of code! jajaja
Re: It accepted!
Posted by Ngoc Nguyen Dinh 3 Nov 2013 23:58
2*3.14159*r = d*Pi
Re: It accepted!
Posted by yutr777 27 Dec 2013 10:13
d*R - It means the length of circle