https://www.urionlinejudge.com.br/judge/en/problems/view/2542 URI показывает ошибку времени выполнения, но я не знаю, где проблема.
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int A, n, m, l, cm, cl;
long mar, leo;
while(input.hasNext())
{
n = input.nextInt();
m = input.nextInt();
l = input.nextInt();
long[][] cardMar = new long[m][n];
long[][] cardLeo = new long[l][n];
for(int i=0;i<m;++i)
{
for(int j=0;j<n;++j)
{
cardMar[i][j] = input.nextLong();
}
}
for(int i=0;i<m;++i)
{
for(int j=0;j<n;++j)
{
cardLeo[i][j] = input.nextLong();
}
}
cm = input.nextInt()-1;
cl = input.nextInt()-1;
A = input.nextInt()-1;
mar = cardMar[cm][A];
leo = cardLeo[cl][A];
if(mar == leo)
System.out.println("Empate");
else if(mar > leo)
System.out.println("Marcos");
else
System.out.println("Leonardo");
}
}
}