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.
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
This checker actually seems like it would be simple. The constraints R, C \leq 20 are there for a reason - so the checker can brute-force all possible obstacle locations and compute the exact outcome for each one. If each outcome is different, then the solution is valid, otherwise, it may be possible that you canāt tell the difference, so the solution is wrong.
so if generate random routes to nowhere each time ( ensuring they are distinct final ), still it would be accepted?
No, because the route has to be the same regardless of the obstacleās position.
my bad. Thanks for the reponse tho !!
which software you used to make this grid ?
please do tell me .
i think the question should be much more clear
The announcement and change in statement has to be wrong, right?
ok i am not getting it so let say if we have a grid (top left at 0,0) and obstacle at (1,1) and command is āDRRRDā (D is down as (x,y)=>(x+1,y) and same others) so will the final pos will be (0,2) or not ??? if not then what will be the final position.
I canāt find why my approach is giving WA.
my code.
I think my code is mapping unique co-ordinate for each possible coordinate of obstacle.
From my approach let final coordinate of robot be (x,y).
Then, obstacleās x co-ordinate will be= x and obstacleās y co-ordinate will be = (y-r).
Help!
And one more thing , can solution for r=1 and c=20 be DRRRā¦(R repeated 19 times) ??? here (0,0) is assumed at top left and r is row and c is col ,
D move make (x,y)=>(x+1,y)
and R make(x,y)=>(x,y+1)
because in this case all the final positions will be different for ex. let r=1 and c=3
the DRR
if obstacle at (1,1) final pos is (1,0)
if (1,2) -> final (1,1)
if (1,3)-> final (1,2)
as all are different so we have the answer and same for r=1 and c=20
or am i wrong somewhere ?
I was using the same approach. But still I didnāt understand it why it is not the valid solution
Wait, D
should be (x, y) \to (x, y - 1), shouldnāt it?
I got the image on google lol. Just search for ācartesian planeā. It is the 6th image there. I used the native image editing software on my computer to draw straight red lines.
just for simplicity take D as x,y -> x+1,y
well you can take whatever you like i was comfortable in that so i wrote that but sry if i confused you
Can anyone tell me why this solution gets AC(for subtask 1) while this gets WA? shouldnāt we go up as C = 20? What am I missing?
The confusing part was that it would make D
the same movement as R
I think
Hereās an example: your path is (0, 0) \to (0, 1) \to (1, 1) \to (1, 2) \to (2, 2), but the obstacle is in (1, 1). So youād get to (0, 1), but the move to (1, 1) would be blocked. So you instead move to (0, 2) (ignore the previous move), then (1, 2).