Rezultati

Up. imeNalogaJezikRezultatČas oddaje
_NABLA-2017 Škatle Python 3 Se ne prevede 20. apr '17 @ 20:18

Izpis prevajalnika:
  File "source.py3", line 11
    q.push(num):
               ^
SyntaxError: invalid syntax

Ocenjevani program (skatle.py):
foo = input().split()
n = int(foo[0])
d = int(foo[1])
dick = {}
boxes = []

import queue

def dfs(s, num):
	q = queue.Queue()
	q.push(num):
	already = []
	while q:
		for n in q.pop():
			already.append(n)
			for i in s[n]:
				if not i in already:
					q.push[i]  

g = [[0]*n  for j in range(n)]
for i in range(n):
	line = [int(x) for x in input().split()]
	line.sort()
	for j, box in enumerate(boxes):
		for c, d in zip(box, line):
			if c <= d:
				break
		else:
			g[i][j] = 1
	boxes.append(line)	

s = [[] for i in range(n)]

for j, vertex in enumerate(g):
	for idx, connect in enumerate(vertex):
		if connect:
			s[j].append(idx)


print(s) 	
m=0
for i in range(len(s)):
	t=dfs(s,i)
	if t>m:
		m=t