Rezultati

Up. imeNalogaJezikRezultatČas oddaje
@memo2498F1-2017 Škatle Python 3 100/100OK 20. apr '17 @ 18:15

Test Točke Porabljen spomin Porabljen čas Status
#1 6/6 8,594 MiB 0,000 s OK
#2 6/6 8,625 MiB 0,000 s OK
#3 6/6 8,633 MiB 0,000 s OK
#4 6/6 8,625 MiB 0,000 s OK
#5 6/6 8,625 MiB 0,000 s OK
#6 7/7 8,609 MiB 0,000 s OK
#7 7/7 8,586 MiB 0,000 s OK
#8 7/7 8,613 MiB 0,000 s OK
#9 7/7 8,621 MiB 0,000 s OK
#10 7/7 8,602 MiB 0,000 s OK
#11 7/7 8,609 MiB 0,000 s OK
#12 7/7 8,652 MiB 0,000 s OK
#13 7/7 8,645 MiB 0,000 s OK
#14 7/7 8,648 MiB 0,000 s OK
#15 7/7 8,629 MiB 0,000 s OK

Ocenjevani program (skatle.py):
import sys

N, D = [int(x) for x in sys.stdin.readline().strip().split()]


skatle = []

for i in range(N):
    trenutna = [int(x) for x in sys.stdin.readline().strip().split(' ')]
    skatle.append(sorted(trenutna, reverse=True))
    
skatle.sort()

#print(skatle)

def primerjaj(list1, list2):
    for i in range(len(list1)):
        if list1[i] >= list2[i]:
            return False
    return True

vrednosti = []

for i in range(N):
    skatla = skatle[i]
    vrednost_skatle = 0
    for j in range(i):
        if primerjaj(skatle[j], skatla):
            vrednost_skatle = max(vrednost_skatle, 1 + vrednosti[j])
    vrednosti.append(vrednost_skatle)
    
#print(vrednosti)
print(max(vrednosti) + 1)