Submit solution
Points:
0.18 (partial)
Time limit:
1.0s
Memory limit:
512M
Input:
stdin
Output:
stdout
Problem type
Allowed languages
C, C++, Go, Java, Kotlin, Pascal, PyPy, Python, Rust, Scratch
Cho ~m~ dãy là hoán vị của ~n~ số tự nhiên đầu tiên
Tìm độ dài dãy con chung dài nhất của ~m~ dãy đó
Input
Dòng đầu chứa số hai số nguyên ~n~ và ~m~ ~(1 \leq n \leq 1000~, ~1 \leq m \leq 10)~
~M~ dòng sau mỗi dòng chứa ~n~ số nguyên là dãya hoán vị của ~n~ số tự nhiên đầu tiên
Output
Đưa ra một dòng là độ dài lớn nhất của dãy con chung
Sample Input
5 3
1 5 3 4 2
1 3 4 2 5
3 1 5 4 2
Sample Output
3
Note
Dãy con chung dài nhất là ~1~, ~4~, ~2~
Comments
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.