Matrix path min cost

please check my error in the code and tell me how can i pass variable sized 2d array without using vector of vector
Question link:: https://practice.geeksforgeeks.org/problems/minimum-cost-path/0
Code link :: https://ide.codingblocks.com/s/107468

just gave the mat array a fixed size according to constraint like here 50
or either declare n globally