Rezultati

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

Test Točke Porabljen spomin Porabljen čas Status
#1 6/6 8,516 MiB 0,000 s OK
#2 6/6 8,637 MiB 0,000 s OK
#3 6/6 8,535 MiB 0,000 s OK
#4 6/6 8,625 MiB 0,000 s OK
#5 6/6 8,516 MiB 0,000 s OK
#6 7/7 8,602 MiB 0,000 s OK
#7 7/7 8,527 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,629 MiB 0,000 s OK
#11 7/7 8,594 MiB 0,000 s OK
#12 7/7 8,672 MiB 0,000 s OK
#13 7/7 8,633 MiB 0,000 s OK
#14 7/7 8,715 MiB 0,000 s OK
#15 7/7 8,699 MiB 0,000 s OK

Ocenjevani program (skatle.pz.py):
import sys

#sys.stdin = open("sk.in")

inp = sys.stdin

skatle = []

N, D = map(int, inp.readline().strip().split())

for j in range(N):
    t = tuple(sorted(tuple(map(int, inp.readline().split())), reverse=True))
    skatle.append(t)

skatle.sort(reverse=True)

maxxx = [0 for j in range(N)]


# a > b
# b vsewbovana v a
def vseb(a, b):
    for j in range(len(a)):
        if a[j] <= b[j]:
            return False
    return True

def maxx(i):
    if maxxx[i]:
        return maxxx[i]
    ma = 1
    for j in range(i+1, N):
        if vseb(skatle[i], skatle[j]):
            ma = max(ma, maxx(j) + 1)
    maxxx[i] = ma
    return ma


for j in range(N):
    maxx(j)

print(max(maxxx))