public int longestIncreasingContinuousSubsequenceII(int[][] A) {
        // Write your code here
        if (A == null || A.length == 0 || A[0].length == 0)
            return 0;
        int[][] dp = new int[A.length][A[0].length];
        for (int i = 0; i < A.length; ++i) {
            for (int j = 0; j < A[0].length; ++j) {
                if (dp[i][j] == 0)
                dfs(A, dp, i, j);
            }
        }
        return max;
    }