I have following Python3 code which works perfectly with my windows machine
but give run time error on the code Jam:
import numpy as np
from collections import OrderedDict
result = OrderedDict()
for case in range(int(input())):
numRows = numCols = 0
mat = np.array([input().split() for _ in range(int(input()))],
dtype=int)
matTrace = np.trace(mat)
for row in range(mat.shape[0]):
if len(set(mat[row][:])) != mat.shape[0]:
numRows += 1
if len(set(mat[:,row])) != mat.shape[0]:
numCols += 1
result[case + 1] = [matTrace, numRows, numCols]
for case in result:
print(f"Case #{case}: ", *result[case])
Please can anyone provide the reason?
--
You received this message because you are subscribed to the Google Groups
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-code/af322684-1863-4448-9b18-4cbf5ac338fe%40googlegroups.com.