prog.cpp:3:2: error: ‘vector’ does not name a type
vector<vector<int> > dp, vis;
^~~~~~
prog.cpp:10:28: error: ‘vector’ has not been declared
int longestIncreasingPath(vector<vector<int>>& matrix) {
^~~~~~
prog.cpp:10:34: error: expected ‘,’ or ‘...’ before ‘<’ token
int longestIncreasingPath(vector<vector<int>>& matrix) {
^
prog.cpp:25:10: error: ‘vector’ has not been declared
int dfs(vector<vector<int>>& matrix, int x, int y) {
^~~~~~
prog.cpp:25:16: error: expected ‘,’ or ‘...’ before ‘<’ token
int dfs(vector<vector<int>>& matrix, int x, int y) {
^
prog.cpp: In member function ‘int Solution::longestIncreasingPath(int)’:
prog.cpp:12:11: error: ‘matrix’ was not declared in this scope
int n = matrix.size();
^~~~~~
prog.cpp:16:3: error: ‘dp’ was not declared in this scope
dp.resize(n, vector<int>(m, -1));
^~
prog.cpp:16:3: note: suggested alternative: ‘dx’
dp.resize(n, vector<int>(m, -1));
^~
dx
prog.cpp:16:16: error: ‘vector’ was not declared in this scope
dp.resize(n, vector<int>(m, -1));
^~~~~~
prog.cpp:16:23: error: expected primary-expression before ‘int’
dp.resize(n, vector<int>(m, -1));
^~~
prog.cpp:20:11: error: ‘max’ was not declared in this scope
ans = max(ans, dfs(matrix, i, j));
^~~
prog.cpp: In member function ‘int Solution::dfs(int)’:
prog.cpp:26:17: error: ‘x’ was not declared in this scope
if (isoutsize(x, y)) {
^
prog.cpp:26:20: error: ‘y’ was not declared in this scope
if (isoutsize(x, y)) {
^
prog.cpp:29:7: error: ‘dp’ was not declared in this scope
if (dp[x][y] != -1) {
^~
prog.cpp:29:7: note: suggested alternative: ‘dx’
if (dp[x][y] != -1) {
^~
dx
prog.cpp:29:10: error: ‘x’ was not declared in this scope
if (dp[x][y] != -1) {
^
prog.cpp:29:13: error: ‘y’ was not declared in this scope
if (dp[x][y] != -1) {
^
prog.cpp:34:16: error: ‘x’ was not declared in this scope
int nextx = x + dx[i];
^
prog.cpp:35:16: error: ‘y’ was not declared in this scope
int nexty = y + dy[i];
^
prog.cpp:36:36: error: ‘matrix’ was not declared in this scope
if(!isoutsize(nextx, nexty) && matrix[x][y] < matrix[nextx][nexty])
^~~~~~
prog.cpp:37:10: error: ‘max’ was not declared in this scope
ans = max(ans, dfs(matrix , nextx,nexty));
^~~
prog.cpp:39:10: error: ‘dp’ was not declared in this scope
return dp[x][y] = ans + 1;
^~
prog.cpp:39:10: note: suggested alternative: ‘dx’
return dp[x][y] = ans + 1;
^~
dx
prog.cpp:39:13: error: ‘x’ was not declared in this scope
return dp[x][y] = ans + 1;
^
prog.cpp:39:16: error: ‘y’ was not declared in this scope
return dp[x][y] = ans + 1;
^