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

Common Board

Rope 1020 to all the people that got accept.
Posted by Jivko Ganev 24 Oct 2000 06:46
Ok I think 1020 is really simple problem, but I keep
getting W.A. . I use arctan to obtain the angle between
every three adjacent vertices. When i get the angle i set
it to pi - the angle and measure the partition of the
circle with r * (the angle).After i get all the partitions
i add them and add all the distances between every 2
adjacent vertices.I handle the n=1 case with writing 2*pi*r
and the n = 2 with writing 2*the distance + 2*pi*r.Also i
want to ask if i have the number 10.446 I should output
10.45 ie write(smth:0:2) or 10.44.I had created a convex
generating program to debug.Here are some sample inputs(i
used write(smth:0:2):
sample 1
8 5
12 23
42 25
78 43
83 55
81 69
32 73
5 68
6 49
result1
251.21
sample2
7 5
3 1
80 31
92 42
87 94
64 99
11 96
5 59
result2
354.71
sample3
6 5
30 0
72 11
95 29
84 92
9 89
1 29
result3
344.59
Re: Rope 1020 to all the people that got accept.
Posted by longman cheng(@Killer team of ZJU) 24 Oct 2000 14:31
no need to compute the angels,
just sum up all the distance between to adjust points,and
add 2*pi*r to the sum,you get the correct answer.
Re: Rope 1020 to all the people that got accept.
Posted by Renat Makayev 24 Oct 2000 14:37
> Ok I think 1020 is really simple problem, but I keep
> getting W.A. . I use arctan to obtain the angle between
> every three adjacent vertices. When i get the angle i set
> it to pi - the angle and measure the partition of the
> circle with r * (the angle).After i get all the
partitions
> i add them and add all the distances between every 2
> adjacent vertices.I handle the n=1 case with writing
2*pi*r
> and the n = 2 with writing 2*the distance + 2*pi*r.Also i
> want to ask if i have the number 10.446 I should output
> 10.45 ie write(smth:0:2) or 10.44.I had created a convex
> generating program to debug.Here are some sample inputs(i
> used write(smth:0:2):
> sample 1
> 8 5
> 12 23
> 42 25
> 78 43
> 83 55
> 81 69
> 32 73
> 5 68
> 6 49
> result1
> 251.21
> sample2
> 7 5
> 3 1
> 80 31
> 92 42
> 87 94
> 64 99
> 11 96
> 5 59
> result2
> 354.71
> sample3
> 6 5
> 30 0
> 72 11
> 95 29
> 84 92
> 9 89
> 1 29
> result3
> 344.59
>
I wrote
  {l:Extended;}
  l:=2*Pi*R + SumOfAllDistancesBetweenTheCenters;
  Write(l:0:2);
I got accept
Excuse me for my English
Re: Rope 1020 to all the people that got accept.
Posted by Petko Minkov 25 Oct 2000 02:14
> Ok I think 1020 is really simple problem, but I keep

 No, it's simpler ;-)

 --

 this stuff - arctan etc. is not needed. my source
code is nearly 100-200 bytes and the task can be
solved with just a little bit of maths. and by the
way, my arc tan and cosine theorem stuff had wrong
answer - probably caused by some rounding errs