#D. CS240 Project Problem 3

    传统题 1000ms 256MiB

CS240 Project Problem 3

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

Description

Given an n×nn \times n matrix, an Increasing Path in the matrix is a path which starts at an arbitrary cell, and where the values of cells along the path are strictly increasing. Design an algorithm to find a longest increasing path in a given input matrix, and output the path's length.

Format

Input

An n×nn\times n matrix MM, which each cell contains a value Mi,jM_{i,j}.

Output

The length of a longest increasing path in the matrix.

Constraints

1n2001\leq n\leq 200 0Mi,j23110\leq M_{i,j}\leq 2^{31}-1 for Ai,jAA_{i,j}\in A

Samples

[[3, 4, 5], [3, 2, 6], [2, 2, 7]]
5
[[9, 9, 3], [6, 6, 8], [2, 1, 1]]
4
[[1]]
1

CS240 project Problem

未参加
状态
已结束
规则
IOI
题目
5
开始于
2023-5-16 10:00
结束于
2023-6-6 23:59
持续时间
518 小时
主持人
参赛人数
92