Hello guys;
please I can't understand how to read input file or how to test your code 
?! exactly how to get a score ? 
I can't understand what's wrong in my code? I get "completed" but no score!

*This is my code: *
import numpy as np

def calc_rc(x):
    for i in range(0,len(x)):
        for j in range(i+1,len(x)):
            if (x[i]==x[j]):
                return 1
    return 0

with open("input.txt","w") as file:
    file.write("3\n4\n1 2 3 4\n2 1 4 3\n3 4 1 2\n4 3 2 1\n4\n2 2 2 2\n2 3 2 
3\n2 2 2 3\n2 2 2 2\n3\n2 1 3\n1 3 2\n1 2 3\n")

with open("input.txt","r+") as file:
    T = int(file.readline())
    j = 1
    while(j <= T):
        N = int(file.readline())
        z = np.zeros((N,N))
        i=0
        while(i < N):
            b = str(file.readline()).replace("\n","").split(" ")
            for k in range(len(b)):
                b[k]=int(b[k])
            z[i] = b
            i+=1
        r=0
        c=0
        k = np.trace(z)
        for l in range(N):
            if (calc_rc(z[l])):
                r+=1
            if(calc_rc(z[:,l])):
                c+=1
        print("Case #{} : {:.0f} {} {}".format(j,k,r,c))
        j+=1

[image: Annotation 2020-04-07 094203.jpg]

-- 
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/f97d4889-1407-4826-964f-dbcf5419cafd%40googlegroups.com.

Reply via email to