ENG  RUSTimus Online Judge
Online Judge
Online contests
About Online Judge
Frequently asked questions
Site news
Problem set
Submit solution
Judge status
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
back to board

Discussion of Problem 1029. Ministry

What the output means?
Posted by phizaz 6 Apr 2011 17:25
I don't understand what the output means?

thanks for help!
Re: What the output means?
Posted by sylap 25 Aug 2013 14:29
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