UKROBOT - Editorial

What will happen if the bot finds an obstacle, whether it will stop there forever or move again if it finds some instructions which satisfy it’s moving rule?

If it has an instruction which will move it into the obstacle, it ignores it, meaning it may do other instructions that don’t force it into the obstacle.

1 Like

I don’t get this part …

In the problem statement, it’s stated that :

When performing an instruction, if the cell it needs to move to is free, then it moves to that cell; otherwise, it stays in its current cell.

So, if the robot is sent to the square with the obstacle, it should stop, right ?
So, why visiting all the possible cells minus 1 is not enough to know the obstacle position ?

3 Likes

nevermind … I see the issue now …

1 Like

I have a little confusion about dircetions.

for subtask 1.

L: move one cell to the left, i.e. from a cell (x,y) to (x−1,y)
R: move one cell to the right, i.e. from a cell (x,y) to (x+1,y)
D: move one cell down, i.e. from a cell (x,y) to (x,y−1)
U: move one cell up, i.e. from a cell (x,y) to (x,y+1)

then U + 20*R will generate sequence like this (00 01 11 21 31 41 51) then how can x be
1<=X<=R (row) ?

1 Like

According to given problem statement, 1<=x<=r && 1<=y<=c ;
According to editorial, 1<=x<=c && 1<=y<=r ;
I think they are different.

1 Like

I am having a feeling that either the question was not well written , or my English is bad as even after 2-3 readings I was unable to understand the problem…

17 Likes

The question says X<=R and Y<=C. You have taken the reverse here. Am i missing anything or is there a misprint in the question?

1 Like

Yeah. Terminology was a bit confusing. R is the number of “rows” - y-positions, and C is the number of “columns” - x-positions.

edit: I think this is wrong

1 Like

Yes,It is wrong not only in editorial but testing too.
when I reversed the r and c in my solution my solution got AC.

1 Like

This line should have been added in the question. Most people interpreted that the robot would just stay immobile after encountering an obstacle. Anyways good problem.

1 Like

There was an announcement regarding the same in the middle of the contest.
I missed the change too :confused:

Statement of UKROBOT had 1 <= X <= C, 1 <= Y <= R, instead of 1 <= X <= R, 1 <= Y <= C, it is fixed now.

this is from announcements.

So I think question was correct but after announcement it got wrong.

1 Like

Yeah… I have considered it will be immobile after it find an obstacle, That’s why I was not able to figure out why I am getting WA

Shit! I misunderstood this problem

1 Like

Exactly!

Okay, to be honest, that announcement is actually tripping me up. Sorry that it ended up so confusing, we probably should have just made it rows/columns instead of Cartesian coordinates.

3 Likes

Hey man! Don’t worry. You are good.

That’s not an issue. It’s okay.
Question quality is what matters which was quite good.

i really wonder how the tester tests these kind of problems