Death First Search - Episode 1 - Puzzle discussion

The warning message means just that. It may mean you have included the output code in the wrong position or execute it wrongly, e.g.

  • you may have overwritten part of the original reading code,
  • the output has been printed more than once by mistake (e.g. in a loop),
  • you have skipped printing output in a certain round (e.g. you place your print statement in an “if” block, and as the “if” condition test fails that part never gets executed).

You may have to put more debug statements in your code to see whether the code is executed in the order expected by you.

The bug has to be on your side. If you reset the code (copy out your own code first!) and run the default code, the error will not appear.

1 Like

Thank you very much for your quick answer.!
You were right, I had to modify one of the nested loops which contained an output statement.
Now I’m on 100%, ambush is the next target :smiley:

1 Like

Tips may help you to solve test 4 with 50 or more remaining links :

- Sort the gateways by number of nodes connected with them. 
- Start your search  from the gateways.

I feel silly posting this, but I am thoroughly stumped. All tests pass in IDE, but on submission tests 2,3 and 4 pass, but the 1st simple test fails? I have no idea why the simple test is failing … This was done in C++.

You may watch the replays to find out what has gone wrong. They can be found under RESULTS > MY REPORT > DETAILS.

Yep, I’ve been looking at that non-stop for the last 1.5 hours :slight_smile: . I never see the Agent move at all. Any way for me to see a debugging console there?

If you click the “share and replay” button at the bottom of the replay player, a new replay window is opened. From there you can click the “…” button to see a bit more information.

I don’t know if my solution is a bit of a hack, but just test at each position if there is a link between this position and remove the link.
I’ve seen much more complex solutions, so I’m wondering

you just need to remove the right link to end up with less moves

I confirm, this was the solution for me. Previously, when my loops didn’t return a link, then i was cutting by default the ‘0 1’ link. So it was cut several times in some cases. The errors came from that. So i created a ‘uncutLinks’ array containing all the links. And each time a link was cut, i removed it from the ‘uncutLinks’ array. Then when my loops didn’t return a link, i was cutting uncutLinks[0] (the first link in the list).
Thank to this, i passed all the test 100%.

Hi,

All my tests pass except for the first one. For some reason the virus doesn’t move on the first test.

Am I doing something wrong?

Could you share your replay link here?

Game Replay - CodinGame

You can check the error messages by clicking the … button. In your case, an error message says your code did not provide an input in due time.

I am providing an input though. I tried to hardcode the solution for the first test, but it still doesn’t work. All the other test cases work perfectly fine.

That may mean your hardcoded solution was never output. Maybe the condition to trigger it was not met, or the output code was not executed before reading the second round’s inputs. You may consider going through your code manually, line by line, to check where the logic may go wrong.

Hello, I’m solving the code in python, and I’m getting integers in the list that are supposed to show the links between each node (n1, n2). Don’t know how to proceed from here.

You may read a blog discussing Episode 2 here. Some of the ideas there apply to Episode 1 too.

This was an excellent coding problem to deal with, thank you for the chance to do this and being so thoughtful!

Could anybody give any hints regarding the 3rd achievement (severing 15 or less connections only on the last test)? I solved the problem 100% with 2 different solutions (a simple check of adjacency as well as a BFS-based one) but I can’t seem to wrap my head around that…