TAN Network puzzle discussion


#84

Haha i had the same issue.


#85

Me too, i did a mistake with the radians conversion... and i searched for hours why only the fifth submit test fails!
Thanks for the tip :smiley:


#86

passed this with a* for the first time, coded in c++, got no problem in case 5 tho.
there's a very familiar verson of this puzzle, called "Defibrillators", in the easy puzzle, where you too have to calculate the distance of two points based on their lat and lon after converted from deg to rad, if anyone has done the puzzle they might not go through the radians to degrees mistake thingy


#87

Weird, I had a seemingly wrong answer on #5 :

  • ...
  • Commerce
  • Republique
  • Pirmil
  • ...

where the solution is supposed to be :

  • ...
  • Commerce
  • Hotel Dieu
  • Aime Delrue
  • Vincent Gache
  • Wattignies
  • Mangin
  • Pirmil
  • ...

Couldn't see any reason why my algo got the wrong result (radians OK, inverting lat/long doesn't change anything,...) so I submitted anyway and got 100%.

Not sure what to think about this...

Edit : Oh cr*p ! Right after posting, I realized I forgot a condition in the update of cost and heuristic ! Now I've got the right result !


#88

I'm having a weird issue possibly within the algorithm itself, and this is the first time I've implemented a Dijkstra (thanks codingame for giving me motivation on that). I can't even pass all the IDE tests (stuck on test 05 -large number of stages-, the rest are ok) Comparing previous help on this thread, I've compared and made sure that I've used radians, implemented distance properly (and final distances match up with the ones listed here) except case 05 which is of 13.424056863059045

When debugging, I'm noticing that my code never finds a replacement path for existing nodes, which is weird. My current code is something like this: (pseudocode)

[redacted for obsoleteness; view post history]

solved: I had an incorrect implementation where I was looking at the wrong path in a specific edge case.

If anyone can point out if anything jumps out at them, please do share. I've been debugging this for two days now.


#89

Hi All,

Just a short feedback. I had the same result as slava_spamec.
And I was sure to have a correct dijkstra, units in radians and no inversion in lat/lon.
After a few logs, I realized that none of my nodes had coordinates initialized at all. They all had 0/0 in lat/lon. What a stupid bug !!!
But even with that, I was still passing correctly all the test except #5 .... dijkstra power :slight_smile:
Of course, after correction, #5 passed like a charm.
To sum up, review carrefully your code, something very basic and stupid is hiding somewhere. And don't really trust the fact that you passed test 1,2,3,4 and 6
Good luck ....


#90

That's my problem!! Thanks!


#91

Thanks, I also overlooked the degree/radian problem, and was wondering why only the validation did not run through ...


#92

Hello,

There is a minor bug on the display of the description of the "Tan Network" puzzle: some html is displayed as text.

Kind regards


#93

Hi,
Does anyone know how to get test cases for debugging outside of CG?
I cannot print more than ~100 lines of text in Console Output Window.


#94

Ok, Problem solved (the hard way). Anyway, you can download test case 03 from here:
http://s000.tinyupload.com/?file_id=07139910495220821165


#95

In the top right edge of the test cases, there are three lines. When you click them, you will see each test case input and output. Doesn't work for round based puzzles, though.


#96

Wow. Thanks a lot, I don't know how I could have missed it :slight_smile: