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

Обсуждение задачи 1789. В поисках Додекаэдра

The real solution
Послано Huang Da 27 авг 2011 11:46
Don't know why so many authors have posted 2*n-1.. That's obviously a wrong solution...

Just think about if the stone is in the odd and the man touches the odd, things will be done smoothly.
Re: The real solution
Послано Solver 24 июл 2026 12:03
The real solution is writing a "checker" for this problem, and then BFS over possible states from 2^n-1 to reach 0 (on bitmask of where it can be located). That produces a nice pattern which is always 2*(n-2), and ofc. shortest possible since it's fair BFS.
2 3 ... n-2 n-1 2 3 .... n-2 n-1 for odd N
2 3 ... n-2 n-1 n-1 n-2 ... 3 2 for even N