Замечания
Проект не компилируется:
/home/zlt/sirius_tasks/FM/zadorozhniy_v/lb4/src/main.cpp: In function 'void findOptimalPath(int**, std::vector<int>&, int, int, int, int)':
/home/zlt/sirius_tasks/FM/zadorozhniy_v/lb4/src/main.cpp:78:29: error: 'numeric_limits' is not a member of 'std'
78 | int path_cost = std::numeric_limits<int>::max();
| ^~~~~~~~~~~~~~
/home/zlt/sirius_tasks/FM/zadorozhniy_v/lb4/src/main.cpp:78:44: error: expected primary-expression before 'int'
78 | int path_cost = std::numeric_limits<int>::max();
| ^~~
/home/zlt/sirius_tasks/FM/zadorozhniy_v/lb4/src/main.cpp:105:34: error: 'numeric_limits' is not a member of 'std'
105 | int min_path_cost = std::numeric_limits<int>::max();
| ^~~~~~~~~~~~~~
/home/zlt/sirius_tasks/FM/zadorozhniy_v/lb4/src/main.cpp:105:49: error: expected primary-expression before 'int'
105 | int min_path_cost = std::numeric_limits<int>::max();
| ^~~
/home/zlt/sirius_tasks/FM/zadorozhniy_v/lb4/src/main.cpp:191:10: error: 'reverse' is not a member of 'std'
191 | std::reverse(path.begin(), path.end());