XrkArul's Problem On Matrix

TimeLimit:1000MS  MemoryLimit:256MB
64-bit integer IO format:%lld
未提交 | 登录后收藏
Problem Description

Given a matrix of n × m, and there's exactly one number required to be selected in each column.


What's more , there are at least two numbers in thesame row among these m selected numbers.


Now XrkArul want to make the minimum number of these m selected numbers to be maximized.


Can you help him solve this problem?

Input

The first line contains two positive integers n and m. (2<n,m<=1000)


Next, n rows, with m positive integers per row , It is guaranteed that each integer not exceeding 1e9.

Output

An integer , the maximized  "minimum number of these m selected numbers" .

SampleInput
2 2
1 2
3 4
SampleOutput
3

Note: Because there are at least two numbers in the same row,In this case there are only two ways to select: select 1 and 2 ,which minimum number is 1 .And select 3 and 4,which minimum number is 3. So the maximized "minimum number of selected numbers" is 3.
Submit
题目统计信息详细
总AC数13
通过人数10
尝试人数20
总提交量49
AC率20.41%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: