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

Обсуждение задачи 1029. Министерство

phizaz What the output means? [1] // Задача 1029. Министерство 6 апр 2011 17:25
I don't understand what the output means?

thanks for help!
sylap Re: What the output means? // Задача 1029. Министерство 25 авг 2013 14:29
OUTPUT:
3 3 2 1 1

MOVE 1: 1st floor [3]rd room
MOVE 2: 2nd floor [3]rd room
MOVE 3: 2nd floor [2]nd room
MOVE 4: 2nd floor [1]st room
MOVE 5: 3rd floor [1]st room

More Detailed:
Let out[] be the output array. If out[i] == out[i+1] then it means that you go one floor up, as there is no point in revisiting the same official. Otherwise you go to one of the neighboring rooms. If out[i] + 1 == out[i+1] then you go to the right neighboring room. Else if out[i] - 1 == out[i+1] then you go to the left neighboring room.

Hope it helped you. And hope that my C-style like syntax didn't make it hard to understand  :)

Edited by author 25.08.2013 14:31