CF1288D.Minimax Problem
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given n arrays a1 , a2 , ..., an ; each array consists of exactly m integers. We denote the y -th element of the x -th array as ax,y .
You have to choose two arrays ai and aj ( 1≤i,j≤n , it is possible that i=j ). After that, you will obtain a new array b consisting of m integers, such that for every k∈[1,m] bk=max(ai,k,aj,k) .
Your goal is to choose i and j so that the value of k=1minmbk is maximum possible.
输入格式
The first line contains two integers n and m ( 1≤n≤3⋅105 , 1≤m≤8 ) — the number of arrays and the number of elements in each array, respectively.
Then n lines follow, the x -th line contains the array ax represented by m integers ax,1 , ax,2 , ..., ax,m ( 0≤ax,y≤109 ).
输出格式
Print two integers i and j ( 1≤i,j≤n , it is possible that i=j ) — the indices of the two arrays you have to choose so that the value of k=1minmbk is maximum possible. If there are multiple answers, print any of them.
输入输出样例
输入#1
6 5 5 0 3 1 2 1 8 9 1 3 1 2 3 4 5 9 1 0 3 7 2 3 0 6 3 6 4 1 7 0
输出#1
1 5