Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.048 s | 13 KBi |
#2 |
Correcto
|
0.045 s | 14 KBi |
#3 |
Correcto
|
0.083 s | 10 KBi |
#4 |
Correcto
|
0.08 s | 33 KBi |
#5 |
Correcto
|
0.082 s | 10 KBi |
#6 |
Correcto
|
0.049 s | 13 KBi |
#7 |
Correcto
|
0.08 s | 10 KBi |
#8 |
Correcto
|
0.046 s | 13 KBi |
#9 |
Correcto
|
0.054 s | 14 KBi |
#10 |
Correcto
|
0.049 s | 13 KBi |
#11 |
Correcto
|
0.05 s | 14 KBi |
#12 |
Correcto
|
0.082 s | 10 KBi |
#13 |
Correcto
|
0.069 s | 51 KBi |
#14 |
Correcto
|
0.08 s | 51 KBi |
#15 |
Correcto
|
0.054 s | 13 KBi |
#16 |
Correcto
|
0.077 s | 15 KBi |
#17 |
Correcto
|
0.069 s | 16 KBi |
#18 |
Correcto
|
0.071 s | 17 KBi |
#19 |
Correcto
|
0.138 s | 11 KBi |
#20 |
Correcto
|
0.075 s | 16 KBi |
import java.io.*; import java.util.StringTokenizer; class Main { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; st = new StringTokenizer(br.readLine()); int filascolumnas = Integer.parseInt(st.nextToken()); int matriz[][] = new int[filascolumnas][filascolumnas]; int columnas = 0; int filas = 0; int di = 0; int dd = 0; for(int i=0;i<filascolumnas;i++){ st = new StringTokenizer(br.readLine()); for(int j=0;j<filascolumnas;j++){ matriz[i][j]=Integer.parseInt(st.nextToken()); } } for(int i=0;i<filascolumnas;i++){ for(int j=0;j<filascolumnas;j++){ filas+=matriz[i][j]; columnas+=matriz[j][i]; if(i==j){ di+=matriz[i][j]; dd+=matriz[i][filascolumnas-j-1]; } } } if(filas/filascolumnas+columnas/filascolumnas+di+dd==di*4){ System.out.println("Yes"); }else{ System.out.println("No"); } } }