ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Общий форум

Rope 1020 to all the people that got accept.
Послано Jivko Ganev 24 окт 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.
Послано longman cheng(@Killer team of ZJU) 24 окт 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.
Послано Renat Makayev 24 окт 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.
Послано Petko Minkov 25 окт 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