Rezultati

Up. imeNalogaJezikRezultatČas oddaje
TDT-2018 Dolenjec Python 3 0/100Napačen odgovor (WA) 10. maj '18 @ 18:43

Test Točke Porabljen spomin Porabljen čas Status
#1 3/3 9,121 MiB 0,000 s OK
#2 3/3 9,055 MiB 0,000 s OK
#3 3/3 9,129 MiB 0,000 s OK
#4 3/3 9,121 MiB 0,000 s OK
#5 3/3 9,125 MiB 0,000 s OK
#6 3/3 9,055 MiB 0,000 s OK
#7 3/3 9,059 MiB 0,000 s OK
#8 3/3 9,039 MiB 0,000 s OK
#9 3/3 8,961 MiB 0,000 s OK
#10 3/3 9,125 MiB 0,000 s OK
#11 3/3 9,125 MiB 0,000 s OK
#12 3/3 8,969 MiB 0,000 s OK
#13 3/3 9,145 MiB 0,000 s OK
#14 3/3 8,895 MiB 0,000 s OK
#15 3/3 9,133 MiB 0,000 s OK
#16 3/3 9,133 MiB 0,000 s OK
#17 3/3 9,145 MiB 0,000 s OK
#18 3/3 9,059 MiB 0,000 s OK
#19 3/3 9,199 MiB 0,000 s OK
#20 3/3 9,129 MiB 0,000 s OK
#21 3/3 9,035 MiB 0,000 s OK
#22 3/3 9,121 MiB 0,000 s OK
#23 0/3 34,105 MiB 0,923 s Napačen odgovor
Tvoj izhod:
​DA
<<<EOF>>>
Pravilen izhod:
​NE
<<<EOF>>>
#24 3/3 35,055 MiB 0,719 s OK
#25 3/3 34,160 MiB 0,817 s OK
#26 3/3 22,387 MiB 0,549 s OK
#27 3/3 19,281 MiB 0,563 s OK
#28 0/3 34,270 MiB 0,735 s Napačen odgovor
Tvoj izhod:
​DA
<<<EOF>>>
Pravilen izhod:
​NE
<<<EOF>>>
#29 3/3 34,277 MiB 0,801 s OK
#30 3/3 22,168 MiB 0,585 s OK
#31 3/3 18,832 MiB 0,608 s OK
#32 3/3 16,305 MiB 0,531 s OK
#33 4/4 8,957 MiB 0,000 s OK

Ocenjevani program (dolenc.py):
from collections import deque


def df(v, pot=[]):
    global graf, gostilne

    pot += [v]

    if v in graf:
        for sosed in graf[v]:
            if sosed in pot:
                semvciklu = False

                for p in pot:
                    if not semvciklu and p == sosed:
                        semvciklu = True

                    if semvciklu:
                        if p in gostilne:
                            1/0

            else:
                pot = df(sosed, pot)

    return pot


n, m, d, q = map(int, input().split())
gostilne = list(map(int, input().split()))

graf = dict()

for i in range(m):
    a, b = map(int, input().split())

    if a not in graf:
        graf[a] = []

    graf[a].append(b)

try:
    df(q)
    print('NE')
except:
    print('DA')