Monika And Song
All submissions for this problem are available.
A good friend of Monika asks her to sing a song. She always refuses to do so. One day she agrees to sing a song but on a condition. As she is a smart girl she wants to sing a song of very less time span. She gives her friend a chart having a matrix of n*m in which each element t is an Integer that represent the time span of each song. As she knows a lot of songs, n and m may be large. Now she asks her friend to choose a row from which she will select a song to sing. As her friend is aware of her trick, so he wants to make the selection so that she will give him pleasure of listening to the song for a large amount of time. Find the time span for which the boy will be able to listen her song if both of them make optimal move.
First line of each input consists of two space separated integers n and m.
For each of next n lines, each line has m integers denoting the time span of each song.
Print a single integer as the answer to the corresponding input.
Input: 3 3 6 1 5 3 3 3 4 10 1 Output: 3
As selecting the first and third row will result in giving the time span as 1 so row 2 will be selected.
|Tags||alzr2016, easy, game-theory, greedy, implementation, kumarranjan01|
|Time Limit:||0.1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH 3.6, PHP, PYP3|
Fetching successful submissions
If you are still having problems, see a sample solution here.