### alpenglow's blog

By alpenglow, history, 2 weeks ago,

How to solve 10022 — Delta-wave from UVa?

• -17

 » 2 weeks ago, # |   0 A good practice would be to mention your progress so far and where exactly you're stuck. It makes it easier for others to help you.
•  » » 2 weeks ago, # ^ |   0 I'm not stuck at any valid approach. All the approaches I tried were wrong eventually.
 » 2 weeks ago, # |   0 up
 » 13 days ago, # | ← Rev. 4 →   0 CodeFirst of all, find row and column coordinates. row = ceil(sqrt(num)) col = num - (row - 1) * (row - 1) Then, look at the photo and consider these intersections, there are at most 3 unique (yellow) intersections, you should find those and go through it, meaning from the starting point go to that intersection and then go to the end. Take the minimum out of these three (or two or one) paths. When three unique intersection exists then the answer is just travelling between the levels. Otherwise you should go south-west and then east or south-east and then west if the are not in the same level, if they are, then the answer is the difference between column coordinates.