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

Обсуждение задачи 1265. Зеркало

Description of solution for all and for WA#9! /// I DID IT!!! It's my 200'th problem)) And how I have 666 rank =))))
Послано Leonid (SLenik) Andrievskiy 20 июл 2011 03:11
I DID IT!!! It's my 200'th problem)) And how I have 666 rank =))))

----------

Preamble.
I've just solved this problem in C# using only Double type (64-bit floating point) and using only operations: +, - and *.
My method also can be used with only integer numbers. But in that way you'll need to code 128-bit signed integer type.

You have 4 points: "the banker’s eye" [name it Eye], "the victim" [name it Victim], "first mirror coordinate" [name it Mirror1], "second mirror coordinate" [name it Mirror2].

At first you should check whether Eye and Victim are in one halfplane relative to the mirror line. If they are not, then answer is INVISIBLE.

And now starting the most interesting part of solution.

My first thought was to build mirrored lines of sight (first: see from Eye, refraction point is Mirror1; and second: see from Eye, refraction point is Mirror2) ans check whether Victim is between that mirrored lines of sight.

But it requires more precision than double can offer.

And then I understand that there's another way to solve that problem!!

Hint1:
Build an equation, that depends of Eye, Victim, Mirror1, Mirror2, and RefractionPoint.
The last parameter is some point on the line formed by Mirror1 and Mirro2 points.
This equation must be true if the angle of incidence (between Eye and mirror) equals to the angle of reflection (between Victim and mirror) in RefractionPoint.
The only operation you need is +, -, * and /. But if you dispose of division and move all to the left side of the equation you'll get a function that equals to 0 when the angle of incidence equals to the angle of reflection in RefractionPoint and not equal to 0 otherwise.

Hint2:
The fact about that function: the sign of its returning value can say you a direction where to find that point.

And the last hint:
The jury do not ask you to find the refraction point =) They only ask you to determine if Victim is seen from Eye (!!!!). In other words "is there exists a RefractionPoint between Mirror1 and Mirror2 that function we've built equals to 0 in that point?"

Well, I think it is enough to solve this problem =))

Edited by author 20.07.2011 03:15
Re: Description of solution for all and for WA#9! /// I DID IT!!! It's my 200'th problem)) And how I have 666 rank =))))
Послано fenden 25 дек 2014 07:51