Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Unidirectional TSP [UVA—116]—DP

Правка en3, от towhid1zaman, 2020-05-04 09:22:56

How Can I solve this -( Unidirectional TSP ) problem !

Problem : Given an m x n matrix of integers, you are to write a program that computes a path of minimal weight. A path starts anywhere in column 1 (the first column) and consists of a sequence of steps terminating in column n (the last column). A step consists of traveling from column i to column i+1 in an adjacent (horizontal or diagonal) row. The first and last rows (rows 1 and m) of a matrix are considered adjacent, i.e., the matrix “wraps” so that it represents a horizontal cylinder. The weight of a path is the sum of the integers in each of the n cells of the matrix that are visited.

Will be grateful if anyone can help. Thank You.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский towhid1zaman 2020-05-04 11:41:00 8
en3 Английский towhid1zaman 2020-05-04 09:22:56 4 Tiny change: 'roblem :\nGiven an' -> 'roblem :\n\n\nGiven an'
en2 Английский towhid1zaman 2020-05-04 09:17:28 10
en1 Английский towhid1zaman 2020-05-04 09:16:25 853 Initial revision (published)