hackercup / 2023 /finals /programming_paths_part_2_sol.md
wjomlex's picture
2023 Problems
ff444f7 verified
|
raw
history blame
414 Bytes
The same observations we used for chapter 1 also apply to chapter 2, we simply need to find a more compact way to create a long path with alcoves. We need a main path of about length \(40\) to make any number up to \(10{,}000\).
Here's a possible approach that fits on a \(10\) × \(10\) grid:
```
@.....#.#.
#.#.#.#...
.#.#..#.#.
.....#..#.
#.#.#..##.
...#.#.#..
.#.#.#..#.
..#...#.#.
#...#....#
..#..#.#..
```