2069 - 電機資節上機考 (5 Maze Cost Sort) Scoreboard

Time

2020/06/15 18:30:00 2020/06/15 20:30:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
12830 電機系 - 資料結構上機考-5

12830 - 電機系 - 資料結構上機考-5   

Description

  • Let’s develop a program to sort the cost of building mazes.
  • Hint: It is not necessary to solve the mazes to obtain the cost of the mazes. You can use "for loop" to count the number.
     
  • Cost factors (more is costlier)
    • N4: Number of crossroads
    • N3: Number of T junctions
    • N1: Number of dead ends
      • Note that the entry and target are not dead ends
  • Overall cost
    • (N4 + N3 + N1)
  • Tie breaker
    • N4 --> N3 --> Larger serial number is costlier
  • Example

Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss