Rezultati

Up. imeNalogaJezikRezultatČas oddaje
OgresOfWekmar2017 Škatle Python 3 0/100Prekoračen čas (TLE) 20. apr '17 @ 19:42

Test Točke Porabljen spomin Porabljen čas Status
#1 6/6 8,613 MiB 0,000 s OK
#2 6/6 8,605 MiB 0,000 s OK
#3 6/6 8,625 MiB 0,000 s OK
#4 6/6 8,625 MiB 0,000 s OK
#5 6/6 8,629 MiB 0,000 s OK
#6 7/7 8,598 MiB 0,000 s OK
#7 7/7 8,625 MiB 0,000 s OK
#8 7/7 8,621 MiB 0,000 s OK
#9 7/7 8,598 MiB 0,000 s OK
#10 7/7 8,617 MiB 0,000 s OK
#11 7/7 8,602 MiB 0,000 s OK
#12 7/7 8,688 MiB 0,000 s OK
#13 7/7 8,648 MiB 0,000 s OK
#14 0/7 8,539 MiB 2,027 s Prekoračen čas
#15 7/7 8,648 MiB 0,000 s OK

Ocenjevani program (sklatle.py):
def pase_v(X, Y):
    Z = Y[:]
    for x in X:
        manjse = [t for t in Z if t < x]
        if manjse == []:
            return False
        Z.remove(max(manjse))
    return True

n,d=input().split()
skatle=[]
for i in range(int(n)):
    skatle.append(list(map(int,input().split())))

pase_v_lists=[[] for i in skatle]

for n,i in enumerate(skatle):
    for m,j in enumerate(skatle):
        if j!=i:
            if pase_v(i,j):
                pase_v_lists[n].append(m)

#print(pase_v_lists)

best=0
for n,i in enumerate(pase_v_lists):
    parent={}
    dists={n:1}
    todo = [n]
    while todo:
        cur = todo.pop()
        for neigh in pase_v_lists[cur]:
            if neigh not in parent or dists[neigh]<dists[cur]+1:
                parent[neigh]=cur
                dists[neigh]=dists[cur]+1
                todo.append(neigh)
    best=max(best,max(dists.values()))

print(best)