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

Обсуждение задачи 1016. Кубик на прогулке

Hello, everybody!

I tryed to solve this problem for a week. I DO NOT KNOW WHAT TO DO. I can't think out anything :(

Thanks.
Yaroslavtsev Grigory (SpbSPU) Re: Help, please! How to solve this problem? Any hits, please (+) [5] // Задача 1016. Кубик на прогулке 2 фев 2005 21:12
Dijkstra, Dijkstra... You can make a graph, where every vertex defines a state of the cube (I mean position and rotation) and every edge defines how much does it cost to move from one position to the other, then use Dijkstra, Bellman or whatever you want. I think it will help.

Edited by author 02.02.2005 21:21
Aleksey Meshnikovsky Thank you very much! I got AC! (-) // Задача 1016. Кубик на прогулке 3 фев 2005 16:20
I think BFS is useable too!
I think you can write that iff you have already accepted your solution.
JTim about BFS // Задача 1016. Кубик на прогулке 16 янв 2011 22:06
I think you can use BFS if numbers on top, bottom, left, right, front and back sides of cube are equal, else Dijkstra or bruteforce :)