Horitzontals iguals
Submit solution
Points:
10
Time limit:
5.0s
Memory limit:
256M
Author:
Problem types
Allowed languages
C#, Go, Java
Donada una matriu de nombres enters, cal mostrar per pantalla el si hi ha una fila que té tots els números iguals. En cas que hi hagi més d'una, cal indicar només la primera trobada.
Input Format
Primera línia:
- \(N\): el nombre de files de la matriu.
- \(M\): el nombre de columnes de la matriu.
Resta de \(N\) línies:
- Els \(M\) nombres que componen la fila, separant amb un espai cada número.
Constraints
- \(N\) i \(M > 0\)
Output Format
- Si hi ha una fila que té tots els números iguals:
La fila <f> té tots els números iguals.
. - Si no hi ha cap:
No hi ha cap fila amb els números iguals.
.
Sample Input 0
3 3
0 0 2
1 1 1
5 1 6
Sample Output 0
La fila 1 té tots els números iguals.
Sample Input 1
3 3
0 1 2
3 1 4
5 2 5
Sample Output 1
No hi ha cap fila amb els números iguals.
Sample Input 2
3 5
1 8 1 9 2
7 2 1 2 2
3 3 3 3 3
Sample Output 2
La fila 2 té tots els números iguals.
Sample Input 3
4 4
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
Sample Output 3
La fila 0 té tots els números iguals.
Sample Input 4
4 1
1
1
1
1
Sample Output 4
La fila 0 té tots els números iguals.
Sample Input 5
1 4
1 1 1 1
Sample Output 5
La fila 0 té tots els números iguals.