|
|
back to boardDiscussion of Problem 1020. RopeWA#3 I couldn't understand my mistake! On my tests it works correct. program project1; var n, i : longint; r, res, x, y, x1, y1, x0, y0 : extended; begin {$IFNDEF ONLINE_JUDGE} assign(input, 'input.txt'); assign(output, 'output.txt'); reset(input); rewrite(output); {$ENDIF} readln(n, r); readln(x, y); x0:=x; y0:=y; res:=2*pi*r; for i:=1 to n-1 do begin readln(x1, y1); res:=res+sqrt(sqr(x1-x)+sqr(y1-y)); y:=y1; x:=x1; end; res:=trunc(res*100)/100; write((res+sqrt(sqr(x1-x0)+sqr(y1-y0))):1:2); {$IFNDEF ONLINE_JUDGE} close(input); close(output); {$ENDIF} end. Re: WA#3 I've got the same problem=) May be there is a mistake with counting doubles (extended) and printing the answer... I suppose Edited by author 03.03.2011 23:46 Edited by author 03.03.2011 23:47 Re: WA#3 On the test 3 n=1, so you need to print the perimeter of nail. Good luck Re: WA#3 On the test 3 n=1, so you need to print the perimeter of nail. Good luck thanks helped Re: WA#3 for n=1,r=1. What will be the answer? is there any effect on axes position? |
|
|