练65.2 跳房子
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Description
The cows are playing a non-traditional version of the children's "hopscotch" game. Instead of a linear arrangement of numbered squares, they have created a grid of numbers, aligned with the and axes. The cows skillfully jump from number to number in the grid: forward, backward, left, or right (never diagonally), landing on another number in the grid. They continue jumping (using the same rules), possibly landing on numbers they've already visited. After a total of five jumps, their path forms a six-digit integer (which may start with , e.g., ). Find the total number of distinct integers that can be formed in this way.
Input Format
Lines to : The grid, each line contains integers.
Output Format
Line : The total number of distinct integers that can be formed.
Sample
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 2 1
1 1 1 1 115
20251122 C班作业(7)
- Status
- Done
- Problem
- 2
- Open Since
- 2025-11-22 0:00
- Deadline
- 2025-11-30 23:59
- Extension
- 24 hour(s)