█████████ ████ ███░░░░░███ ░░███ ███ ░░░ ██████ ███████ ██████ ██████ ░███ ███░░███ ███░░███ ███░░███ ███░░███ ░███ ░███ ░███░███ ░███ ░███████ ░███ ░███ ░░███ ███░███ ░███░███ ░███ ░███░░░ ░███ ░███ ░░█████████ ░░██████ ░░████████░░██████ ░░██████ ░░░░░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░░

Envío 1142

Problema 0xe1 - Cuadrado mágico

  • Autor: javierandresgp
  • Fecha: 2020-10-11 02:24:26 UTC (Hace alrededor de 4 años)
Caso # Resultado Tiempo Memoria
#1
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 1, in <module>
    import numpy as n
ModuleNotFoundError: No module named 'numpy'
0.026 s 3 KBi
#2
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 1, in <module>
    import numpy as n
ModuleNotFoundError: No module named 'numpy'
0.021 s 3 KBi
#3
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 1, in <module>
    import numpy as n
ModuleNotFoundError: No module named 'numpy'
0.024 s 3 KBi
#4
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 1, in <module>
    import numpy as n
ModuleNotFoundError: No module named 'numpy'
0.024 s 3 KBi
#5
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 1, in <module>
    import numpy as n
ModuleNotFoundError: No module named 'numpy'
0.022 s 3 KBi
#6
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 1, in <module>
    import numpy as n
ModuleNotFoundError: No module named 'numpy'
0.024 s 3 KBi
#7
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 1, in <module>
    import numpy as n
ModuleNotFoundError: No module named 'numpy'
0.022 s 3 KBi
#8
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 1, in <module>
    import numpy as n
ModuleNotFoundError: No module named 'numpy'
0.028 s 3 KBi
#9
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 1, in <module>
    import numpy as n
ModuleNotFoundError: No module named 'numpy'
0.03 s 7 KBi
#10
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 1, in <module>
    import numpy as n
ModuleNotFoundError: No module named 'numpy'
0.021 s 3 KBi
#11
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 1, in <module>
    import numpy as n
ModuleNotFoundError: No module named 'numpy'
0.021 s 3 KBi
#12
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 1, in <module>
    import numpy as n
ModuleNotFoundError: No module named 'numpy'
0.023 s 3 KBi
#13
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 1, in <module>
    import numpy as n
ModuleNotFoundError: No module named 'numpy'
0.023 s 3 KBi
#14
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 1, in <module>
    import numpy as n
ModuleNotFoundError: No module named 'numpy'
0.024 s 3 KBi
#15
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 1, in <module>
    import numpy as n
ModuleNotFoundError: No module named 'numpy'
0.022 s 3 KBi
#16
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 1, in <module>
    import numpy as n
ModuleNotFoundError: No module named 'numpy'
0.021 s 3 KBi
#17
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 1, in <module>
    import numpy as n
ModuleNotFoundError: No module named 'numpy'
0.022 s 3 KBi
#18
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 1, in <module>
    import numpy as n
ModuleNotFoundError: No module named 'numpy'
0.023 s 3 KBi
#19
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 1, in <module>
    import numpy as n
ModuleNotFoundError: No module named 'numpy'
0.021 s 3 KBi
#20
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 1, in <module>
    import numpy as n
ModuleNotFoundError: No module named 'numpy'
0.021 s 3 KBi
Puntos totales: 0 / 100

Código

import numpy as n
matrix = []
size = int(input())
count = size
while (count > 0):
    elements = list(map(int, input().rsplit(" ")))
    matrix.append(elements)
    count -= 1
matrix = n.array(matrix)
sumRows = [sum(matrix[i]) for i in range(size)]
sumColumns = [sum(matrix[:, i]) for i in range(size)]
sumDiagonal = sum(n.diagonal(matrix))
sumAntiDiagonal = sum(n.fliplr(matrix).diagonal())
if sumRows == sumColumns and sumDiagonal == sumAntiDiagonal:
    print("Yes")
else:
    print("No")