Shadows of the Knight - Episode 2 - Puzzle discussion


split this topic #23

2 posts were merged into an existing topic: Shadows of the Knight - Episode 1 - Puzzle discussion


#24

Thank you so much!!! I finally could be able to solve this puzzle by reading your comment! First time trying, I could only got all the test but the last one (which is really frustrating anyway :frowning: ) . Then after reading your statement, I could finally understanding what to do.

Guys (or girls), if you guys keep trying to mirror the coordinate through the bisector, it would make you jump back-and-forth around the edge if the the bomb is near the edge. And it would be reallyyyyyyyyyyyy time-consuming, considering that you have to visit the same old window multiple times. (And for me, the result is 5 rounds away from the actual number of rounds needed to solve the final case.)

So, my advice for you is that focus on the statement that Geropy has stated:

For anyone who could not wrap their head around this idea, I would give you a little hint:
Try to approach the edge fast, really, (but not too fast :wink: ).

By doing this, I got 3 spare rounds in the last case. And I really hope you could come up with something like this, or even better!!! ^^

And as always,
Happy Coding!!!


#25

coz the bomb is at 999,999


#26

5 ≤ W constraint is not true in 3rd test, the tower one, since W = 1


#27

Fixed, thanks.


#28

I also did the binary search separately for both coordinates with one optimization:
Because you cannot jump off of the grid, sometimes your next jump will not give you any information at all, just adjusts the position of the bat for future jumps. It makes sense to make these zero information jumps for both coordinates with a single two dimensional jump. Which means you have to work on both coordinates “in parallel”.


#29

Hi, I’m stuck on this problem for a while.
I’m searching for the X and Y coordinates separately and everything’s fine since I pass every test.
But here is my problem : when I submit my code, I get 87% cause I pass every test but the FIRST one.
Of course, there is no way to know why I don’t pass this test because of submission mode.
Did any of you have the same problem or any idea of what could be the reason (I know the data in sub mode are slightly different)?


#30

Maybe this was the most messy task for me so far. No matter what I’ve tried it didn’t work, I had really tough time understanding why. At the end I got the logic with many many little tweaks and trials and errors and still everything is not clear to me why my solution works :slight_smile:


#31

I don’t understand, how could people solve this by searching for the X and Y coordinates separately. With two separate binary searches, IDE test cases 07 and 08 use too much jumps and fail for me, so I’m currently stuck at 75% and don’t know how to progress without hardcoding some jump-orders for specific testcases.


#32

All I could say is searching separately for X and Y allows to reach 100% both during training and validation phase.

The sole tip I could give you is: if you know your next move won’t learn you anything, then change your search axis.