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

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

About the formula
Послано Nguyen Nguyen 18 дек 2011 02:21
I think when the toast rotates an angle of w after t seconds, it will land if only the distance it traveled ( 0.5 * 981 * t * t ) plus its projection on the orthogonal ( 0.5 * l * |sin(w)| ) equals to h.

But I got WA when implementing this approach, then change the latter expression into l/2 and got AC. Could anyone explain this?

Edited by author 18.12.2011 02:22
Re: About the formula
Послано HellKitsune 7 май 2012 22:43
l/2 works because when the middle of given toast is l/2 cm away from the ground, it won't change sides anymore.
Projection approach would work too, but it's tricky to implement. Binary and ternary searches won't work because distance + projection is neither monotonous nor unimodal (think about case when h is small and the toast is spinning very fast).