How to solve 10022 — Delta-wave from UVa?

# | User | Rating |
---|---|---|

1 | tourist | 3682 |

2 | ecnerwala | 3603 |

3 | Benq | 3549 |

4 | Radewoosh | 3494 |

5 | Petr | 3452 |

6 | ksun48 | 3413 |

7 | maroonrk | 3406 |

8 | Miracle03 | 3314 |

9 | scott_wu | 3313 |

10 | Um_nik | 3299 |

# | User | Contrib. |
---|---|---|

1 | 1-gon | 214 |

2 | Errichto | 189 |

3 | awoo | 188 |

4 | rng_58 | 187 |

5 | SecondThread | 186 |

6 | Um_nik | 177 |

7 | Ashishgup | 176 |

8 | maroonrk | 173 |

9 | antontrygubO_o | 172 |

10 | -is-this-fft- | 169 |

How to solve 10022 — Delta-wave from UVa?

↑

↓

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Apr/20/2021 17:42:47 (i1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

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.

I'm not stuck at any valid approach. All the approaches I tried were wrong eventually.

up

maybe this will help you

link

Thanks, but this is not clear at all. It is auto translated from Chinese or something.

Code

First of all, find row and column coordinates.

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.