Rezultati

Up. imeNalogaJezikRezultatČas oddaje
Jakub-2018 Nič nas ne sme presenetiti! Python 3 0/100Napaka med izvajanjem / ob izhodu (RTE) 19. apr '18 @ 16:50

Test Točke Porabljen spomin Porabljen čas Status
#1 12/12 9,059 MiB 0,000 s OK
#2 0/12 9,031 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Traceback (most recent call last):
  File "source.py3", line 25, in <module>
    for i in E[m]:
IndexError: list index out of range
#3 0/12 9,148 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Traceback (most recent call last):
  File "source.py3", line 25, in <module>
    for i in E[m]:
IndexError: list index out of range
#4 0/12 36,078 MiB 1,460 s Program je končal z neničelno kodo
Stderr:
Traceback (most recent call last):
  File "source.py3", line 25, in <module>
    for i in E[m]:
IndexError: list index out of range
#5 0/13 8,984 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Traceback (most recent call last):
  File "source.py3", line 25, in <module>
    for i in E[m]:
IndexError: list index out of range
#6 0/13 30,574 MiB 3,181 s Prekoračen čas
#7 0/13 29,961 MiB 3,197 s Prekoračen čas
#8 0/13 30,574 MiB 3,233 s Prekoračen čas

Ocenjevani program (NNNP.py):
import fileinput
from collections import deque


mesta, p = input().split()
E = [[] for i in range(int(mesta))]

for i in range(int(mesta)-1):
	v1, v2 = input().split()
	E[int(v1)-1].append(int(v2))
	E[int(v2)-1].append(int(v1))

for line in fileinput.input():
	visited = [False for i in range(int(mesta))]
	isuporno = [False for i in range(int(mesta))]
	uporna = line.split()[1:]
	q = deque()
	for i in uporna:
		isuporno[int(i)-1] = True
	q.appendleft(uporna[0])
	
	while q:
		m = int(q.pop())
		if visited[m-1]: continue
		for i in E[m]:
			if isuporno[i-1] and not visited[i-1]:
				q.appendleft(i)
		visited[m-1] = True
		
		
	s = True
	for i in range(int(mesta)):
		if visited[i-1] != isuporno[i-1]: s=False
		
	if s: print('ALAAAARHM')
	else: print('NASLEDNJI')